Make sure MSVC knows it's running on Windows. Have MSVC clean up it's worthless object files after itself.

This commit is contained in:
n-a-c-h
2005-07-11 17:45:41 +00:00
parent d5053f4461
commit dba28a70f0
2 changed files with 10 additions and 8 deletions

View File

@@ -377,6 +377,7 @@ endif
${PSR}: $< ${PSR}: $<
ifeq (${ENV},msvc) ifeq (${ENV},msvc)
cl /EHsc /Fe$@ parsegen.cpp cl /EHsc /Fe$@ parsegen.cpp
${DELETECOMMAND} parsegen.obj
else else
ifeq (${ENV},dos) ifeq (${ENV},dos)
gpp -O3 -o $@ parsegen.cpp gpp -O3 -o $@ parsegen.cpp

View File

@@ -36,17 +36,18 @@ using namespace std;
#include <errno.h> #include <errno.h>
#ifdef _MSC_VER //MSVC
typedef int ssize_t;
#define strcasecmp stricmp
#define __WIN32__
#endif
#if defined(__MSDOS__) || defined(__WIN32__) #if defined(__MSDOS__) || defined(__WIN32__)
#define SLASH_STR "\\" #define SLASH_STR "\\"
#else #else
#define SLASH_STR "/" #define SLASH_STR "/"
#endif #endif
#ifdef _MSC_VER //MSVC
typedef int ssize_t;
#define strcasecmp stricmp
#endif
#define LINE_LENGTH 2048*10 #define LINE_LENGTH 2048*10
char line[LINE_LENGTH]; char line[LINE_LENGTH];
@@ -263,12 +264,12 @@ ssize_t enhanced_atoi(const char *str)
system("gcc -o eatio.exe eatio.c -s"); system("gcc -o eatio.exe eatio.c -s");
#endif #endif
//Older MSVCs too stupid to concatinate on their own system("."SLASH_STR"eatio.exe");
system((string(".")+string(SLASH_STR)+"eatio.exe").c_str());
remove("eatio.c"); remove("eatio.c");
remove("eatio.exe"); remove("eatio.exe");
remove("eatio.obj"); //Needed for stupid MSVCs which leave object files lying around
ifstream in_stream("eatio.res"); ifstream in_stream("eatio.res");
if (in_stream) if (in_stream)
{ {