mcpp: fix build with clang 16

This commit is contained in:
Weijia Wang 2023-11-10 02:28:13 +01:00
parent 32da89a1a1
commit 7b9f87ff71
2 changed files with 28 additions and 0 deletions

View File

@ -14,6 +14,10 @@ stdenv.mkDerivation (finalAttrs: {
hash= "sha256-T4feegblOeG+NU+c+PAobf8HT8KDSfcINkRAa1hNpkY=";
};
patches = [
./readlink.patch
];
configureFlags = [ "--enable-mcpplib" ];
meta = with lib; {

View File

@ -0,0 +1,24 @@
From 1c4b0f26614bff331eb8a9f2b514309af6f31fd0 Mon Sep 17 00:00:00 2001
From: Jose <pepone@users.noreply.github.com>
Date: Mon, 26 Jun 2023 16:43:43 +0200
Subject: [PATCH] Add 'unistd' header for readlink (#8)
---
src/system.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/system.c b/src/system.c
index a3501f9..646caf6 100644
--- a/src/system.c
+++ b/src/system.c
@@ -37,6 +37,11 @@
* 2. append the system-dependent routines in this file.
*/
+
+#ifndef _MSC_VER
+# include <unistd.h> // For readlink()
+#endif
+
#if PREPROCESSED
#include "mcpp.H"
#else