diff --git a/source/lib/sysdep/win/win_internal.h b/source/lib/sysdep/win/win_internal.h index d28f45a02c..094fd235a5 100755 --- a/source/lib/sysdep/win/win_internal.h +++ b/source/lib/sysdep/win/win_internal.h @@ -238,11 +238,22 @@ typedef struct _SYSTEM_POWER_INFORMATION #include "types.h" // intptr_t + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _CRTIMP */ + extern "C" { -extern intptr_t _get_osfhandle(int); -extern int _open_osfhandle(intptr_t, int); -extern int _open(const char* fn, int mode, ...); -extern int _close(int); +_CRTIMP intptr_t _get_osfhandle(int); +_CRTIMP int _open_osfhandle(intptr_t, int); +_CRTIMP int _open(const char* fn, int mode, ...); +_CRTIMP int _close(int); #ifndef NO_WINSOCK extern __declspec(dllimport) int __stdcall WSAStartup(unsigned short, void*); diff --git a/source/lib/sysdep/win/wposix.h b/source/lib/sysdep/win/wposix.h index 04a0b53f8d..932adc1602 100755 --- a/source/lib/sysdep/win/wposix.h +++ b/source/lib/sysdep/win/wposix.h @@ -33,6 +33,17 @@ extern "C" { #endif + +/* Define _CRTIMP */ + +#ifndef _CRTIMP +#ifdef _DLL +#define _CRTIMP __declspec(dllimport) +#else /* ndef _DLL */ +#define _CRTIMP +#endif /* _DLL */ +#endif /* _CRTIMP */ + // // // @@ -211,7 +222,7 @@ extern int munmap(void* start, size_t len); #define O_NONBLOCK 0x1000000 -extern int open(const char* fn, int mode, ...); +_CRTIMP int open(const char* fn, int mode, ...); // @@ -229,12 +240,12 @@ extern int open(const char* fn, int mode, ...); #define read _read #define write _write -extern int close(int); -extern int access(const char*, int); +_CRTIMP int close(int); +_CRTIMP int access(const char*, int); extern int chdir(const char*); #define getcwd _getcwd -extern char* getcwd(char*, int); +_CRTIMP char* getcwd(char*, int); // user tests if available via #ifdef; can't use enum. #define _SC_PAGESIZE 1