Use _WIN32 instead of WIN32 to detect Windows
`WIN32` is not defined when building a 64-bit executable on Windows with Clang. `_WIN32` is the more appropriate option here. http://web.archive.org/web/20191012035921/http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system contains a handy table/matrix of the options and why this is best.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
// get mmap() sorted out
|
||||
#ifdef MYFILE_MMAP
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <windows.h>
|
||||
@@ -59,13 +59,13 @@ int munmap(void *start, size_t length)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#else // WIN32
|
||||
#else // _WIN32
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#endif // WIN32
|
||||
#endif // _WIN32
|
||||
#endif // MYFILE_MMAP
|
||||
|
||||
#ifdef MYFILE_MMAP
|
||||
@@ -74,7 +74,7 @@ rtengine::IMFILE* rtengine::fopen (const char* fname)
|
||||
{
|
||||
int fd;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
|
||||
fd = -1;
|
||||
// First convert UTF8 to UTF16, then use Windows function to open the file and convert back to file descriptor.
|
||||
|
||||
Reference in New Issue
Block a user