From 549af06fa90248a930260f3ee5890af2edf656ec Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 31 Mar 2000 05:58:16 +0000 Subject: [PATCH] Applied CoderJoe's (Thad Ward) win32 patchs. compiles, links and runs. BTW, win32 targets now use opendir etc. --- common/common_quakedef.h | 14 +++--- common/dirent.c | 4 +- common/gl_vidnt.c | 10 ++++ common/quakefs.c | 71 ++++----------------------- common/sys_common.c | 4 +- qw_client/qw_client.dsp | 19 ++++++-- qw_server/qw_server.dsp | 12 ++++- tools/gas2masm/gas2masm.c | 2 +- tools/gas2masm/gas2masm.dsp | 4 +- uquake/sys_win.c | 20 ++++---- uquake/uquake.dsp | 31 ++++++------ winsup/dirent.h | 96 +++++++++++++++++++++++++++++++++++++ winsup/sys/dirent.h | 58 ---------------------- 13 files changed, 178 insertions(+), 167 deletions(-) create mode 100644 winsup/dirent.h delete mode 100644 winsup/sys/dirent.h diff --git a/common/common_quakedef.h b/common/common_quakedef.h index d1dec5c..04eeaef 100644 --- a/common/common_quakedef.h +++ b/common/common_quakedef.h @@ -47,17 +47,15 @@ #include #endif -#if defined(_WIN32) && !defined(WINDED) && !defined(GLQUAKE) -void VID_LockBuffer (void); -void VID_UnlockBuffer (void); -#else -#define VID_LockBuffer() -#define VID_UnlockBuffer() -#endif - #include #include +#ifdef _WIN32 +#define FNMATCH_FLAGS FNM_CASEFOLD +#else +#define FNMATCH_FLAGS 0 +#endif + #ifndef max #define max(a,b) ((a) > (b) ? (a) : (b)) diff --git a/common/dirent.c b/common/dirent.c index fab64ec..3012bf1 100644 --- a/common/dirent.c +++ b/common/dirent.c @@ -1,7 +1,7 @@ /* * dirent.c * - * Derived from DIRLIB.C by Matt J. Weinstein + * Derived from DIRLIB.C by Matt J. Weinstein * This note appears in the DIRLIB.H * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 * @@ -27,6 +27,8 @@ #define SUFFIX "*" #define SLASH "\\" +#define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) /* is a directory */ + /* * opendir * diff --git a/common/gl_vidnt.c b/common/gl_vidnt.c index c3151be..25975c3 100644 --- a/common/gl_vidnt.c +++ b/common/gl_vidnt.c @@ -1993,3 +1993,13 @@ void VID_InitCvars() { // It may not look it, but this is important } + +void VID_LockBuffer (void) +{ + // need empty function, because the #define method was just silly +} + +void VID_UnlockBuffer (void) +{ + // need empty function, because the #define method was just silly +} diff --git a/common/quakefs.c b/common/quakefs.c index dae5419..51ee24e 100644 --- a/common/quakefs.c +++ b/common/quakefs.c @@ -44,10 +44,8 @@ #include #include -#ifndef _WIN32 // Tonik #include #include -#endif #ifdef WIN32 #include @@ -192,6 +190,13 @@ void COM_Path_f (void) } } +/* +============ +COM_Maplist_f + +============ +*/ + void COM_Maplist_f (void) { searchpath_t *search; @@ -217,8 +222,8 @@ void COM_Maplist_f (void) if (!dir_ptr) continue; while ((dirent = readdir (dir_ptr))) - if (!fnmatch ("*.bsp", dirent->d_name, 0) - || !fnmatch ("*.bsp.gz", dirent->d_name, 0)) + if (!fnmatch ("*.bsp", dirent->d_name, FNMATCH_FLAGS) + || !fnmatch ("*.bsp.gz", dirent->d_name, FNMATCH_FLAGS)) Con_Printf ("%s\n", dirent->d_name); closedir (dir_ptr); } @@ -710,60 +715,6 @@ pack_t *COM_LoadPackZipFile (char *packfile) } #endif -#ifdef _WIN32 -// Yes i know, but at least the project does compile for Win32! -// Let's wait until someone implements Sys_FindFirst(), -// Sys_FindNext(), Sys_FindClose() for every platform. -// -// I wonder why didn't Mercury like the pak*.pak system? -// -// Or maybe taniwha will kindly mail me dirent.h and maybe -// i will port opendir etc to Win32? -// -- Tonik -void -COM_LoadGameDirectory(char *dir) -{ - int i; - searchpath_t *search; - pack_t *pak; - char pakfile[MAX_OSPATH]; - qboolean done = false; - - for ( i=0 ; !done ; i++ ) { // Load all Pak1 files - snprintf(pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i); - - pak = COM_LoadPackFile(pakfile); - - if( !pak ) { - done = true; - } else { - search = Z_Malloc (sizeof(searchpath_t)); - search->pack = pak; - search->next = com_searchpaths; - com_searchpaths = search; - } - } - -#ifdef GENERATIONS - for (done=false, i=0 ; !done ; i++ ) { // Load all Pak3 files. - snprintf(pakfile, sizeof(pakfile), "%s/pak%i.qz", dir, i); - - pak = COM_LoadPackZipFile(pakfile); - - if(!pak) { - done = true; - } else { - search = Hunk_Alloc (sizeof(searchpath_t)); - search->pack = pak; - search->next = com_searchpaths; - com_searchpaths = search; - } - } -#endif -} - -#else // !_WIN32 - void COM_LoadGameDirectory(char *dir) { @@ -778,7 +729,7 @@ COM_LoadGameDirectory(char *dir) return; while ((dirent = readdir(dir_ptr))) { - if (!fnmatch("*.pak", dirent->d_name, 0)) { + if (!fnmatch("*.pak", dirent->d_name, FNMATCH_FLAGS)) { snprintf(pakfile, sizeof(pakfile), "%s/%s", dir, dirent->d_name); pak = COM_LoadPackFile(pakfile); @@ -812,8 +763,6 @@ COM_LoadGameDirectory(char *dir) } #endif } -#endif // !_WIN32 - /* ================ diff --git a/common/sys_common.c b/common/sys_common.c index 5595700..a95209d 100644 --- a/common/sys_common.c +++ b/common/sys_common.c @@ -146,9 +146,9 @@ int Sys_FileTime (char *path) int t = VID_ForceUnlockedAndReturnState(); #endif - f = fopen(path, "rb"); + f = Qopen(path, "rb"); if (f) { - fclose(f); + Qclose(f); ret = 1; } #if defined(_WIN32) && !defined(SERVERONLY) diff --git a/qw_client/qw_client.dsp b/qw_client/qw_client.dsp index 8427b57..ba94ab1 100644 --- a/qw_client/qw_client.dsp +++ b/qw_client/qw_client.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /GX /O2 /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "id386" /YX /FD /c +# ADD CPP /nologo /WX /GX /O2 /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /I "../winsup" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "id386" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -73,7 +73,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /Gm /GX /ZI /Od /I "../scitech/include" /I "../common" /I "../qw_common" /I "../qw_client" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "id386" /FR /YX /FD /GZ /c +# ADD CPP /nologo /WX /Gm /GX /ZI /Od /I "../scitech/include" /I "../common" /I "../qw_common" /I "../qw_client" /I "../winsup" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "id386" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -83,7 +83,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 dxguid.lib ..\scitech\lib\win32\vc\mgllt.lib winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/qw-client-win.exe" /pdbtype:sept +# ADD LINK32 dxguid.lib ..\scitech\lib\win32\vc\mgllt.lib winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"Debug/qw-client-win.exe" /pdbtype:sept +# SUBTRACT LINK32 /nodefaultlib !ELSEIF "$(CFG)" == "qw_client - Win32 GLRelease" @@ -100,7 +101,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /GX /O2 /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "QUAKEWORLD" /FR /YX /FD /c -# ADD CPP /nologo /GX /O2 /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "GLQUAKE" /D "id386" /YX /FD /c +# ADD CPP /nologo /WX /GX /O2 /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /I "../winsup" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "GLQUAKE" /D "id386" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -131,7 +132,7 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /GX /O2 /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "GLQUAKE" /D "id386" /YX /FD /c # SUBTRACT BASE CPP /Fr -# ADD CPP /nologo /GX /ZI /Od /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "GLQUAKE" /D "id386" /YX /FD /c +# ADD CPP /nologo /WX /GX /ZI /Od /I "../scitech/include" /I "../qw_common" /I "../common" /I "../qw_client" /I "../qw_server" /I "../winsup" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "QUAKEWORLD" /D "GLQUAKE" /D "id386" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -459,6 +460,10 @@ SOURCE=..\common\d_zpoint.c # End Source File # Begin Source File +SOURCE=..\common\dirent.c +# End Source File +# Begin Source File + SOURCE=..\common\draw.c !IF "$(CFG)" == "qw_client - Win32 Release" @@ -479,6 +484,10 @@ SOURCE=..\common\draw.c # End Source File # Begin Source File +SOURCE=..\common\fnmatch.c +# End Source File +# Begin Source File + SOURCE=..\common\gl_cl_parse.c !IF "$(CFG)" == "qw_client - Win32 Release" diff --git a/qw_server/qw_server.dsp b/qw_server/qw_server.dsp index 8592ecf..98d6f58 100644 --- a/qw_server/qw_server.dsp +++ b/qw_server/qw_server.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /GX /O2 /I "../common" /I "../qw_common" /I "../qw_server" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "QUAKEWORLD" /D "SERVERONLY" /YX /FD /c +# ADD CPP /nologo /WX /GX /O2 /I "../common" /I "../qw_common" /I "../qw_server" /I "../winsup" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "QUAKEWORLD" /D "SERVERONLY" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x419 /d "NDEBUG" # ADD RSC /l 0x419 /d "NDEBUG" @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /Gm /GX /ZI /Od /I "../common" /I "../qw_common" /I "../qw_server" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "QUAKEWORLD" /D "SERVERONLY" /FR /YX /FD /GZ /c +# ADD CPP /nologo /WX /Gm /GX /ZI /Od /I "../common" /I "../qw_common" /I "../qw_server" /I "../winsup" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "QUAKEWORLD" /D "SERVERONLY" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x419 /d "_DEBUG" # ADD RSC /l 0x419 /d "_DEBUG" BSC32=bscmake.exe @@ -104,6 +104,14 @@ SOURCE=..\common\cvar.c # End Source File # Begin Source File +SOURCE=..\common\dirent.c +# End Source File +# Begin Source File + +SOURCE=..\common\fnmatch.c +# End Source File +# Begin Source File + SOURCE=..\common\lib_replace.c # End Source File # Begin Source File diff --git a/tools/gas2masm/gas2masm.c b/tools/gas2masm/gas2masm.c index b130d66..edd79e8 100644 --- a/tools/gas2masm/gas2masm.c +++ b/tools/gas2masm/gas2masm.c @@ -774,7 +774,7 @@ void errorexit (void) } -tokenstat whitespace (char c) +tokenstat whitespace (int c) { if (c == '\n') return LINE_DONE; diff --git a/tools/gas2masm/gas2masm.dsp b/tools/gas2masm/gas2masm.dsp index 66da3a5..20edfdf 100644 --- a/tools/gas2masm/gas2masm.dsp +++ b/tools/gas2masm/gas2masm.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c +# ADD CPP /nologo /W1 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /c +# ADD CPP /nologo /W1 /WX /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/uquake/sys_win.c b/uquake/sys_win.c index 089e3f5..50633aa 100644 --- a/uquake/sys_win.c +++ b/uquake/sys_win.c @@ -144,10 +144,10 @@ int wfilelength (QFile *f) t = VID_ForceUnlockedAndReturnState (); - pos = ftell (f); - fseek (f, 0, SEEK_END); - end = ftell (f); - fseek (f, pos, SEEK_SET); + pos = Qtell (f); + Qseek (f, 0, SEEK_END); + end = Qtell (f); + Qseek (f, pos, SEEK_SET); VID_ForceLockState (t); @@ -164,7 +164,7 @@ int Sys_FileOpenRead (char *path, int *hndl) i = findhandle (); - f = fopen(path, "rb"); + f = Qopen(path, "rb"); if (!f) { @@ -193,7 +193,7 @@ int Sys_FileOpenWrite (char *path) i = findhandle (); - f = fopen(path, "wb"); + f = Qopen(path, "wb"); if (!f) Sys_Error ("Error opening %s: %s", path,strerror(errno)); sys_handles[i] = f; @@ -208,7 +208,7 @@ void Sys_FileClose (int handle) int t; t = VID_ForceUnlockedAndReturnState (); - fclose (sys_handles[handle]); + Qclose (sys_handles[handle]); sys_handles[handle] = NULL; VID_ForceLockState (t); } @@ -218,7 +218,7 @@ void Sys_FileSeek (int handle, int position) int t; t = VID_ForceUnlockedAndReturnState (); - fseek (sys_handles[handle], position, SEEK_SET); + Qseek (sys_handles[handle], position, SEEK_SET); VID_ForceLockState (t); } @@ -227,7 +227,7 @@ int Sys_FileRead (int handle, void *dest, int count) int t, x; t = VID_ForceUnlockedAndReturnState (); - x = fread (dest, 1, count, sys_handles[handle]); + x = Qread (sys_handles[handle], dest, count); VID_ForceLockState (t); return x; } @@ -237,7 +237,7 @@ int Sys_FileWrite (int handle, void *data, int count) int t, x; t = VID_ForceUnlockedAndReturnState (); - x = fwrite (data, 1, count, sys_handles[handle]); + x = Qwrite (sys_handles[handle], data, count); VID_ForceLockState (t); return x; } diff --git a/uquake/uquake.dsp b/uquake/uquake.dsp index e597ecb..8ba5917 100644 --- a/uquake/uquake.dsp +++ b/uquake/uquake.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /GX /O2 /I "../common" /I "../uquake" /I "../scitech/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /YX /FD /c +# ADD CPP /nologo /WX /GX /O2 /I "../common" /I "../uquake" /I "../scitech/include" /I "../winsup" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /Gm /GX /ZI /Od /I "../common" /I "../uquake" /I "../scitech/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /FR /YX /FD /GZ /c +# ADD CPP /nologo /WX /Gm /GX /ZI /Od /I "../common" /I "../uquake" /I "../scitech/include" /I "../winsup" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -81,8 +81,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 dxguid.lib ..\scitech\lib\win32\vc\mgllt.lib winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/uquake-win.exe" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none +# ADD LINK32 dxguid.lib ..\scitech\lib\win32\vc\mgllt.lib winmm.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"Debug/uquake-win.exe" /pdbtype:sept +# SUBTRACT LINK32 /verbose /pdb:none /incremental:no /nodefaultlib !ELSEIF "$(CFG)" == "uquake - Win32 GLRelease" @@ -99,7 +99,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /GX /O2 /I "../common" /I "../uquake" /I "../scitech/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /YX /FD /c -# ADD CPP /nologo /GX /O2 /I "../common" /I "../uquake" /I "../scitech/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /D "GLQUAKE" /YX /FD /c +# ADD CPP /nologo /WX /GX /O2 /I "../common" /I "../uquake" /I "../scitech/include" /I "../winsup" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /D "GLQUAKE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -126,7 +126,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /GX /O2 /I "../common" /I "../uquake" /I "../scitech/include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /D "GLQUAKE" /YX /FD /c -# ADD CPP /nologo /GX /ZI /Od /I "../common" /I "../uquake" /I "../scitech/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /D "GLQUAKE" /FR /YX /FD /c +# ADD CPP /nologo /WX /GX /ZI /Od /I "../common" /I "../uquake" /I "../scitech/include" /I "../winsup" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "UQUAKE" /D "id386" /D "GLQUAKE" /FR /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -456,6 +456,10 @@ SOURCE=..\common\d_zpoint.c # End Source File # Begin Source File +SOURCE=..\common\dirent.c +# End Source File +# Begin Source File + SOURCE=..\common\draw.c !IF "$(CFG)" == "uquake - Win32 Release" @@ -476,6 +480,10 @@ SOURCE=..\common\draw.c # End Source File # Begin Source File +SOURCE=..\common\fnmatch.c +# End Source File +# Begin Source File + SOURCE=..\common\gl_cl_parse.c !IF "$(CFG)" == "uquake - Win32 Release" @@ -1279,17 +1287,6 @@ SOURCE=..\common\vid_win.c # Begin Source File SOURCE=..\common\view.c - -!IF "$(CFG)" == "uquake - Win32 Release" - -!ELSEIF "$(CFG)" == "uquake - Win32 Debug" - -!ELSEIF "$(CFG)" == "uquake - Win32 GLRelease" - -!ELSEIF "$(CFG)" == "uquake - Win32 GLDebug" - -!ENDIF - # End Source File # Begin Source File diff --git a/winsup/dirent.h b/winsup/dirent.h new file mode 100644 index 0000000..c3b7e07 --- /dev/null +++ b/winsup/dirent.h @@ -0,0 +1,96 @@ +/* + * DIRENT.H (formerly DIRLIB.H) + * + * by M. J. Weinstein Released to public domain 1-Jan-89 + * + * Because I have heard that this feature (opendir, readdir, closedir) + * it so useful for programmers coming from UNIX or attempting to port + * UNIX code, and because it is reasonably light weight, I have included + * it in the Mingw32 package. I have also added an implementation of + * rewinddir, seekdir and telldir. + * - Colin Peters + * + * This code is distributed in the hope that is will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAMED. This includeds but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * $Revision$ + * $Author$ + * $Date$ + * + */ + +#ifndef __STRICT_ANSI__ + +#ifndef _DIRENT_H_ +#define _DIRENT_H_ + +/* All the headers include this file. */ +//#include <_mingw.h> + +#include + +#ifndef RC_INVOKED + +#ifdef __cplusplus +extern "C" { +#endif + +struct dirent +{ + long d_ino; /* Always zero. */ + unsigned short d_reclen; /* Always zero. */ + unsigned short d_namlen; /* Length of name in d_name. */ + char* d_name; /* File name. */ + /* NOTE: The name in the dirent structure points to the name in the + * finddata_t structure in the DIR. */ +}; + +/* + * This is an internal data structure. Good programmers will not use it + * except as an argument to one of the functions below. + */ +typedef struct +{ + /* disk transfer area for this dir */ + struct _finddata_t dd_dta; + + /* dirent struct to return from dir (NOTE: this makes this thread + * safe as long as only one thread uses a particular DIR struct at + * a time) */ + struct dirent dd_dir; + + /* _findnext handle */ + long dd_handle; + + /* + * Status of search: + * 0 = not started yet (next entry to read is first entry) + * -1 = off the end + * positive = 0 based index of next entry + */ + short dd_stat; + + /* given path for dir with search pattern (struct is extended) */ + char dd_name[1]; +} DIR; + + +DIR* opendir (const char*); +struct dirent* readdir (DIR*); +int closedir (DIR*); +void rewinddir (DIR*); +long telldir (DIR*); +void seekdir (DIR*, long); + +#ifdef __cplusplus +} +#endif + +#endif /* Not RC_INVOKED */ + +#endif /* Not _DIRENT_H_ */ + +#endif /* Not __STRICT_ANSI__ */ + diff --git a/winsup/sys/dirent.h b/winsup/sys/dirent.h deleted file mode 100644 index c4f20b7..0000000 --- a/winsup/sys/dirent.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Posix dirent.h for WIN32. */ - -/* Including this file should not require any Windows headers. */ - -#ifndef _SYS_DIRENT_H -#define _SYS_DIRENT_H - -#include - -struct dirent -{ - long __d_reserved[4]; - ino_t d_ino; /* Just for compatibility, it's junk */ - char d_name[256]; /* FIXME: use NAME_MAX? */ -}; - -#define __DIRENT_COOKIE 0xdede4242 - -typedef struct -{ - /* This is first to set alignment in non _COMPILING_NEWLIB case. */ - unsigned long __d_cookie; - struct dirent *__d_dirent; - char *__d_dirname; /* directory name with trailing '*' */ - off_t __d_position; /* used by telldir/seekdir */ - unsigned long __d_dirhash; /* hash of directory name for use by - readdir */ - union - { -#ifdef _COMPILING_NEWLIB - struct - { - HANDLE __handle; - char __open_p; - } __d_data; -#endif - char __d_filler[16]; - } __d_u; -} DIR; - -DIR *opendir (const char *); -struct dirent *readdir (DIR *); -void rewinddir (DIR *); -int closedir (DIR *); - -#ifndef _POSIX_SOURCE -off_t telldir (DIR *); -void seekdir (DIR *, off_t loc); - -int scandir (const char *__dir, - struct dirent ***__namelist, - int (*select) (const struct dirent *), - int (*compar) (const struct dirent **, const struct dirent **)); - -int alphasort (const struct dirent **__a, const struct dirent **__b); -#endif /* _POSIX_SOURCE */ - -#endif