We were using a hardcoded checked-in version of the config file on Windows, replace it with the CMake-generated one.
set(HAVE_CONC_GC_AS_DEFAULT 1)
set(MONO_INSIDE_RUNTIME 1)
+TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
+
+if(IS_BIG_ENDIAN)
+ set(TARGET_BYTE_ORDER G_BIG_ENDIAN)
+else()
+ set(TARGET_BYTE_ORDER G_LITTLE_ENDIAN)
+endif()
+
######################################
# AOT CROSS COMPILER SUPPORT
######################################
# EGLIB CHECKS
######################################
-set(GNUC_PRETTY)
-set(GNUC_UNUSED)
-set(BREAKPOINT "G_STMT_START { raise(SIGTRAP); } G_STMT_END")
-if(GCC)
- set(GNUC_UNUSED "__attribute__((__unused__))")
- set(GNUC_NORETURN "__attribute__((__noreturn__))")
- if(HOST_AMD64 OR HOST_X86)
- set(BREAKPOINT "G_STMT_START { __asm__(\"int \$03\"); } G_STMT_END")
- endif()
-endif()
-
-TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
-
-if(IS_BIG_ENDIAN)
- set(TARGET_BYTE_ORDER G_BIG_ENDIAN)
-else()
- set(TARGET_BYTE_ORDER G_LITTLE_ENDIAN)
-endif()
-
-if(IS_BIG_ENDIAN)
- set(ORDER G_BIG_ENDIAN)
-else()
- set(ORDER G_LITTLE_ENDIAN)
-endif()
+set(EGLIB_GNUC_PRETTY)
+set(EGLIB_GNUC_UNUSED)
if(HOST_WIN32)
- set(PATHSEP "\\")
- set(SEARCHSEP ";")
- set(OS "WIN32")
- set(PIDTYPE "void *")
+ set(EGLIB_GNUC_PRETTY "__FUNCTION__")
+ set(EGLIB_BREAKPOINT "__debugbreak()")
+ set(EGLIB_PATHSEP "\\\\")
+ set(EGLIB_SEARCHSEP ";")
+ set(EGLIB_OS "WIN32")
+ set(EGLIB_PIDTYPE "void *")
+ if(HOST_AMD64 OR HOST_ARM64)
+ set(EGLIB_GSIZE_FORMAT "\"Iu\"")
+ else()
+ set(EGLIB_GSIZE_FORMAT "\"u\"")
+ endif()
else()
- set(PATHSEP "/")
- set(SEARCHSEP ":")
- set(OS "UNIX")
- set(PIDTYPE "int")
+ set(EGLIB_BREAKPOINT "G_STMT_START { raise(SIGTRAP); } G_STMT_END")
+ if(GCC)
+ set(EGLIB_GNUC_UNUSED "__attribute__((__unused__))")
+ set(EGLIB_GNUC_NORETURN "__attribute__((__noreturn__))")
+ if(HOST_AMD64 OR HOST_X86)
+ set(EGLIB_BREAKPOINT "G_STMT_START { __asm__(\"int \$03\"); } G_STMT_END")
+ endif()
+ endif()
+ set(EGLIB_PATHSEP "/")
+ set(EGLIB_SEARCHSEP ":")
+ set(EGLIB_OS "UNIX")
+ set(EGLIB_PIDTYPE "int")
+ set(EGLIB_GSIZE_FORMAT "\"lu\"")
endif()
-# FIXME:
-set(GSIZE_FORMAT "\"lu\"")
-
-set(GSIZE "size_t")
-set(GSSIZE "ptrdiff_t")
+set(EGLIB_GSIZE "size_t")
+set(EGLIB_GSSIZE "ptrdiff_t")
#
# END OF EGLIB CHECKS
endif()
configure_file(cmake/config.h.in config.h)
-configure_file(cmake/eglib-config.h.cmake.in mono/eglib/eglib-config.h) # TODO: eglib-config.h is not needed, we're using hardcoded eglib-config.hw
+configure_file(cmake/eglib-config.h.cmake.in mono/eglib/eglib-config.h)
#ifndef __EGLIB_CONFIG_H
#define __EGLIB_CONFIG_H
-/*
- * System-dependent settings
- */
-#define G_GNUC_PRETTY_FUNCTION @GNUC_PRETTY@
-#define G_GNUC_UNUSED @GNUC_UNUSED@
-#define G_BYTE_ORDER @ORDER@
-#define G_GNUC_NORETURN @GNUC_NORETURN@
-#define G_SEARCHPATH_SEPARATOR_S "@SEARCHSEP@"
-#define G_SEARCHPATH_SEPARATOR '@SEARCHSEP@'
-#define G_DIR_SEPARATOR '@PATHSEP@'
-#define G_DIR_SEPARATOR_S "@PATHSEP@"
-#define G_BREAKPOINT() @BREAKPOINT@
-#define G_OS_@OS@
+#ifdef _MSC_VER
+
+#include <io.h>
+#include <stddef.h>
+
+#define MAXPATHLEN 242
+
+#define STDOUT_FILENO (1)
+#define STDERR_FILENO (2)
+
+/* FIXME: what should this be ?*/
+#define X_OK 4 /* This is really read */
+#define WNOHANG 1
+#define F_SETFD 1
+#define FD_CLOEXEC 1
+
+#ifndef __cplusplus
+#undef inline
+#define inline __inline
+#endif
+
+#define strtok_r strtok_s
+
+#undef G_HAVE_UNISTD_H
+#undef G_HAVE_SYS_TIME_H
+#undef G_HAVE_SYS_WAIT_H
+#undef G_HAVE_PWD_H
+#undef G_HAVE_STRNDUP
+#define G_HAVE_GETOPT_H 1
+
+#else
#if @HAVE_ALLOCA_H@ == 1
#define G_HAVE_ALLOCA_H
#define G_HAVE_UNISTD_H
#endif
-typedef @GSIZE@ gsize;
-typedef @GSSIZE@ gssize;
+#endif
-#define G_GSIZE_FORMAT @GSIZE_FORMAT@
+/*
+ * System-dependent settings
+ */
+#define G_GNUC_PRETTY_FUNCTION @EGLIB_GNUC_PRETTY@
+#define G_GNUC_UNUSED @EGLIB_GNUC_UNUSED@
+#define G_BYTE_ORDER @TARGET_BYTE_ORDER@
+#define G_GNUC_NORETURN @EGLIB_GNUC_NORETURN@
+#define G_SEARCHPATH_SEPARATOR_S "@EGLIB_SEARCHSEP@"
+#define G_SEARCHPATH_SEPARATOR '@EGLIB_SEARCHSEP@'
+#define G_DIR_SEPARATOR '@EGLIB_PATHSEP@'
+#define G_DIR_SEPARATOR_S "@EGLIB_PATHSEP@"
+#define G_BREAKPOINT() @EGLIB_BREAKPOINT@
+#define G_OS_@EGLIB_OS@ 1
+#define G_GSIZE_FORMAT @EGLIB_GSIZE_FORMAT@
#if defined (HOST_WATCHOS)
#undef G_BREAKPOINT
#define G_BREAKPOINT() do { printf ("MONO: BREAKPOINT\n"); abort (); } while (0)
#endif
-typedef @PIDTYPE@ GPid;
+typedef @EGLIB_GSIZE@ gsize;
+typedef @EGLIB_GSSIZE@ gssize;
+typedef @EGLIB_PIDTYPE@ GPid;
+
+#ifdef _MSC_VER
+typedef int pid_t;
+#endif
#endif
set(eglib_win32_sources
- eglib-config.hw
gdate-win32.c gdir-win32.c gfile-win32.c gmisc-win32.c
gmodule-win32.c gtimer-win32.c gunicode-win32.c)
+++ /dev/null
-#ifndef __EGLIB_CONFIG_H
-#define __EGLIB_CONFIG_H
-
-/*
- * System-dependent settings
- */
-#define G_GNUC_PRETTY_FUNCTION @GNUC_PRETTY@
-#define G_GNUC_UNUSED @GNUC_UNUSED@
-#define G_BYTE_ORDER @ORDER@
-#define G_GNUC_NORETURN @GNUC_NORETURN@
-#define G_SEARCHPATH_SEPARATOR_S "@SEARCHSEP@"
-#define G_SEARCHPATH_SEPARATOR '@SEARCHSEP@'
-#define G_DIR_SEPARATOR '@PATHSEP@'
-#define G_DIR_SEPARATOR_S "@PATHSEP@"
-#define G_BREAKPOINT() @BREAKPOINT@
-#define G_OS_@OS@
-
-#if @HAVE_ALLOCA_H@ == 1
-#define G_HAVE_ALLOCA_H
-#endif
-
-#if @HAVE_UNISTD_H@ == 1
-#define G_HAVE_UNISTD_H
-#endif
-
-typedef @GSIZE@ gsize;
-typedef @GSSIZE@ gssize;
-
-#define G_GSIZE_FORMAT @GSIZE_FORMAT@
-
-#if defined (HOST_WATCHOS)
-#undef G_BREAKPOINT
-#define G_BREAKPOINT()
-#endif
-
-#if defined (HOST_WASM)
-#undef G_BREAKPOINT
-#define G_BREAKPOINT() do { printf ("MONO: BREAKPOINT\n"); abort (); } while (0)
-#endif
-
-typedef @PIDTYPE@ GPid;
-
-#endif
+++ /dev/null
-#ifndef __EGLIB_CONFIG_H
-#define __EGLIB_CONFIG_H
-
-/*
- * System-dependent settings
- */
-#define G_OS_WIN32 1
-
-#ifdef _MSC_VER
-
-#include <io.h>
-#include <stddef.h>
-
-#define G_GNUC_PRETTY_FUNCTION __FUNCTION__
-#define G_GNUC_UNUSED
-#define G_BYTE_ORDER 1234
-#define G_GNUC_NORETURN
-#define G_BREAKPOINT() __debugbreak()
-#define MAXPATHLEN 242
-
-typedef size_t gsize;
-typedef ptrdiff_t gssize;
-typedef int pid_t;
-
-#define G_DIR_SEPARATOR '\\'
-#define G_DIR_SEPARATOR_S "\\"
-#define G_SEARCHPATH_SEPARATOR_S ";"
-#define G_SEARCHPATH_SEPARATOR ';'
-
-#ifdef _WIN64
-// Correct for Win32 and Win64 since circa 2000.
-#define G_GSIZE_FORMAT "Iu"
-#else
-// Correct for Win32 since circa 1992.
-#define G_GSIZE_FORMAT "u"
-#endif
-
-// https://msdn.microsoft.com/en-us/library/40bbyw78.aspx
-#define STDOUT_FILENO (1)
-#define STDERR_FILENO (2)
-
-/* FIXME: what should this be ?*/
-#define X_OK 4 /* This is really read */
-#define WNOHANG 1
-#define F_SETFD 1
-#define FD_CLOEXEC 1
-
-#ifndef __cplusplus
-#undef inline
-#define inline __inline
-#endif
-
-#define strtok_r strtok_s
-
-#undef G_HAVE_UNISTD_H
-#undef G_HAVE_SYS_TIME_H
-#undef G_HAVE_SYS_WAIT_H
-#undef G_HAVE_PWD_H
-#undef G_HAVE_STRNDUP
-#define G_HAVE_GETOPT_H 1
-
-/* disable the following warnings
- * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
- * C4127: conditional expression is constant
-*/
-#pragma warning(disable:4100 4127)
-#endif
-
-typedef void * GPid;
-#endif
#include <limits.h>
#include <stdint.h>
#include <inttypes.h>
-#ifdef _MSC_VER
-#include <eglib-config.hw>
-#else
#include <eglib-config.h>
-#endif
// - Pointers should only be converted to or from pointer-sized integers.
// - Any size integer can be converted to any other size integer.