summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-03-06 17:10:11 +0100
committerIvan Maidanski <ivmai@mail.ru>2012-03-06 17:11:56 +0100
commit1a4dd0e75fd177ddf7eadf8654057ed243fc0c2d (patch)
tree6382f06d5b1838dcf09e426e7943ebaa24ed33f0 /misc.c
parentcadf0ffa1a90c53f3563cc84def7f11ecb1cbdcf (diff)
Fix GC_READ_ENV_FILE code for Cygwin
* misc.c: Include windows.h for Cygwin if GC_READ_ENV_FILE (required for GC_envfile_init). * misc.c (_MAX_PATH): Move definition to the place before the first use (only Win32).
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/misc.c b/misc.c
index 8db6085..63b9d47 100644
--- a/misc.c
+++ b/misc.c
@@ -26,7 +26,8 @@
#ifdef GC_SOLARIS_THREADS
# include <sys/syscall.h>
#endif
-#if defined(MSWIN32) || defined(MSWINCE)
+#if defined(MSWIN32) || defined(MSWINCE) \
+ || (defined(CYGWIN32) && defined(GC_READ_ENV_FILE))
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
@@ -466,6 +467,11 @@ GC_API void GC_CALL GC_get_heap_usage_safe(GC_word *pheap_size,
}
#endif /* THREADS */
+#if !defined(_MAX_PATH) && (defined(MSWIN32) || defined(MSWINCE) \
+ || defined(CYGWIN32))
+# define _MAX_PATH MAX_PATH
+#endif
+
#ifdef GC_READ_ENV_FILE
/* This works for Win32/WinCE for now. Really useful only for WinCE. */
STATIC char *GC_envfile_content = NULL;
@@ -1108,10 +1114,6 @@ GC_API void GC_CALL GC_enable_incremental(void)
# define IF_NEED_TO_LOCK(x)
# endif /* !THREADS */
-# ifndef _MAX_PATH
-# define _MAX_PATH MAX_PATH
-# endif
-
STATIC HANDLE GC_CreateLogFile(void)
{
# if !defined(NO_GETENV_WIN32) || !defined(OLD_WIN32_LOG_FILE)