ref: ef725ba3b6bb81ca2fe0aa3d37e920cdbb429c20
parent: d687b4ee0c7ac58d9a9e5e50fb1813f47f17681d
author: CYBERDEViL <[email protected]>
date: Thu May 4 18:15:50 EDT 2023
Cross compile with MSYS2
--- a/src/reader.h
+++ b/src/reader.h
@@ -18,11 +18,17 @@
#define H_REWISE_READER
#include <stdio.h>
-#include <linux/limits.h> // PATH_MAX
#include <string.h>
#include <unistd.h> // access, F_OK
#include <stdint.h> // uint32_t
#include <stdlib.h> // malloc
+
+// PATH_MAX
+#ifdef __linux__
+#include <linux/limits.h>
+#elif defined(__CYGWIN__) || defined(_WIN32) || defined(_WIN64)
+#include <limits.h>
+#endif
#include "errors.h"
--- a/src/rewise.c
+++ b/src/rewise.c
@@ -17,7 +17,6 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#include <linux/limits.h> // PATH_MAX, NAME_MAX
#include <stdlib.h>
#include <getopt.h>
#include <time.h>
@@ -26,6 +25,13 @@
#include <sys/stat.h> // mkdir
#include <utime.h>
#include <sys/statvfs.h>
+
+// PATH_MAX, NAME_MAX
+#ifdef __linux__
+#include <linux/limits.h>
+#elif defined(__CYGWIN__) || defined(_WIN32) || defined(_WIN64)
+#include <limits.h>
+#endif
#include "print.h"
#include "reader.h"
--- a/src/wisescript.c
+++ b/src/wisescript.c
@@ -15,9 +15,14 @@
*/
#include <stddef.h>
-#include <linux/limits.h>
#include <string.h>
#include <errno.h>
+
+#ifdef __linux__
+#include <linux/limits.h>
+#elif defined(__CYGWIN__) || defined(_WIN32) || defined(_WIN64)
+#include <limits.h>
+#endif
#include "wisescript.h"