diff --git a/build/premake/premake.lua b/build/premake/premake.lua index 56cd721bdb..1119510baa 100755 --- a/build/premake/premake.lua +++ b/build/premake/premake.lua @@ -326,6 +326,7 @@ function setup_all_libs () source_dirs = { "lib", + "lib/posix", "lib/sysdep", "lib/res", "lib/res/file", @@ -347,7 +348,7 @@ function setup_all_libs () sysdep_dirs = { linux = { "lib/sysdep/unix" }, -- note: RC file must be added to main_exe package. - windows = { "lib/sysdep/win" }, + windows = { "lib/sysdep/win", "lib/sysdep/win/wposix" }, macosx = { "lib/sysdep/osx" }, } tinsert(package.files, sourcesfromdirs(source_root, sysdep_dirs[OS])); diff --git a/source/lib/sysdep/win/wposix/waio.h b/source/lib/sysdep/win/wposix/waio.h index 8346a033bf..8a0b168b28 100644 --- a/source/lib/sysdep/win/wposix/waio.h +++ b/source/lib/sysdep/win/wposix/waio.h @@ -90,7 +90,7 @@ extern int close(int); extern int read (int fd, void* buf, size_t nbytes); // thunk extern int write(int fd, void* buf, size_t nbytes); // thunk -extern _CRTIMP off_t lseek(int fd, off_t ofs, int whence); +extern "C" _CRTIMP off_t lseek(int fd, off_t ofs, int whence); // diff --git a/source/lib/sysdep/win/wposix/wfilesystem.h b/source/lib/sysdep/win/wposix/wfilesystem.h index ce941305ed..fb7992d1d5 100644 --- a/source/lib/sysdep/win/wposix/wfilesystem.h +++ b/source/lib/sysdep/win/wposix/wfilesystem.h @@ -89,8 +89,8 @@ extern char* realpath(const char*, char*); // hence, the file is reported executable if it exists. #define X_OK 0 -extern _CRTIMP int access(const char*, int); +extern "C" _CRTIMP int access(const char*, int); -extern _CRTIMP int rmdir(const char*); +extern "C" _CRTIMP int rmdir(const char*); #endif // #ifndef INCLUDED_WFILESYSTEM diff --git a/source/lib/sysdep/win/wposix/wposix_internal.h b/source/lib/sysdep/win/wposix/wposix_internal.h index b30a5384d2..997ff8a5bc 100644 --- a/source/lib/sysdep/win/wposix/wposix_internal.h +++ b/source/lib/sysdep/win/wposix/wposix_internal.h @@ -17,7 +17,7 @@ // is a last resort (e.g. if the regular CRT headers would conflict). #ifndef _CRTIMP # ifdef _DLL -# define _CRTIMP extern "C" __declspec(dllimport) +# define _CRTIMP __declspec(dllimport) # else # define _CRTIMP # endif