Improve MinGW support.
- Code specific to Windows was #ifdef'ed with _MSC_VER so it wasn't included with MinGW. So _MSC_VER is replaced with _WIN32. - MinGW doesn't support _get_pgmptr() so it is necessary to directly call the Win32 function GetModuleFileName(). This implies including windows.h which in turn causes a name clash with the Win32 function SearchPath(). So the cc65 type SearchPath is renamed to SearchPaths.
This commit is contained in:
@@ -36,15 +36,18 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#if defined(_WIN32)
|
||||
# define O_INITIAL O_BINARY
|
||||
#else
|
||||
# define O_INITIAL 0
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
/* Microsoft compiler */
|
||||
# include <io.h>
|
||||
# pragma warning(disable : 4996)
|
||||
# define O_INITIAL O_BINARY
|
||||
#else
|
||||
/* Anyone else */
|
||||
# include <unistd.h>
|
||||
# define O_INITIAL 0
|
||||
#endif
|
||||
|
||||
/* common */
|
||||
|
||||
Reference in New Issue
Block a user