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:
Oliver Schmidt
2014-03-03 22:12:14 +01:00
parent fcc95f4c1c
commit 50c4fd1c4c
15 changed files with 73 additions and 77 deletions

View File

@@ -2,7 +2,7 @@
/* */
/* filestat.c */
/* */
/* Replacement for buggy Microsoft code */
/* Replacement for Windows code */
/* */
/* */
/* */
@@ -46,8 +46,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__WATCOMC__) && defined(__NT__)
#define BUGGY_OS 1
#if defined(_WIN32)
#include <errno.h>
#include <windows.h>
#endif
@@ -63,7 +62,7 @@
#if defined(BUGGY_OS)
#if defined(_WIN32)
@@ -77,7 +76,7 @@ static time_t FileTimeToUnixTime (const FILETIME* T)
* way to express a number > 32 bit (known to me) but is able to do
* calculations with 64 bit integers, so we need to do it this way.
*/
static const ULARGE_INTEGER Offs = { 0xB6109100UL, 0x00000020UL };
static const ULARGE_INTEGER Offs = { { 0xB6109100UL, 0x00000020UL } };
ULARGE_INTEGER V;
V.LowPart = T->dwLowDateTime;
V.HighPart = T->dwHighDateTime;