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

@@ -44,13 +44,13 @@
SearchPath* LibSearchPath; /* Library path */
SearchPath* ObjSearchPath; /* Object file path */
SearchPath* CfgSearchPath; /* Config file path */
SearchPaths* LibSearchPath; /* Library path */
SearchPaths* ObjSearchPath; /* Object file path */
SearchPaths* CfgSearchPath; /* Config file path */
SearchPath* LibDefaultPath; /* Default Library path */
SearchPath* ObjDefaultPath; /* Default Object file path */
SearchPath* CfgDefaultPath; /* Default Config file path */
SearchPaths* LibDefaultPath; /* Default Library path */
SearchPaths* ObjDefaultPath; /* Default Object file path */
SearchPaths* CfgDefaultPath; /* Default Config file path */
@@ -88,13 +88,13 @@ void InitSearchPaths (void)
AddSubSearchPathFromEnv (CfgDefaultPath, "CC65_HOME", "cfg");
/* Add some compiled-in search paths if defined at compile time. */
#if defined(LD65_LIB)
#if defined(LD65_LIB) && !defined(_WIN32)
AddSearchPath (LibDefaultPath, STRINGIZE (LD65_LIB));
#endif
#if defined(LD65_OBJ)
#if defined(LD65_OBJ) && !defined(_WIN32)
AddSearchPath (ObjDefaultPath, STRINGIZE (LD65_OBJ));
#endif
#if defined(LD65_CFG)
#if defined(LD65_CFG) && !defined(_WIN32)
AddSearchPath (CfgDefaultPath, STRINGIZE (LD65_CFG));
#endif

View File

@@ -49,13 +49,13 @@
extern SearchPath* LibSearchPath; /* Library path */
extern SearchPath* ObjSearchPath; /* Object file path */
extern SearchPath* CfgSearchPath; /* Config file path */
extern SearchPaths* LibSearchPath; /* Library path */
extern SearchPaths* ObjSearchPath; /* Object file path */
extern SearchPaths* CfgSearchPath; /* Config file path */
extern SearchPath* LibDefaultPath; /* Default Library path */
extern SearchPath* ObjDefaultPath; /* Default Object file path */
extern SearchPath* CfgDefaultPath; /* Default Config file path */
extern SearchPaths* LibDefaultPath; /* Default Library path */
extern SearchPaths* ObjDefaultPath; /* Default Object file path */
extern SearchPaths* CfgDefaultPath; /* Default Config file path */