instead, define the FILE_OFFSET_BITS part in the build environment, and remove it...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Mar 2011 14:59:14 +0000 (14:59 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 5 Mar 2011 14:59:14 +0000 (14:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10894 d7cf8633-e32d-0410-b094-e92efae38249

12 files changed:
darkplaces-dedicated.dev
darkplaces-dedicated.dsp
darkplaces-dedicated.vcproj
darkplaces-sdl.dev
darkplaces-sdl.dsp
darkplaces-sdl.vcproj
darkplaces-wgl.vcproj
darkplaces.dev
darkplaces.dsp
fs.c
makefile.inc
quakedef.h

index 4a6341e..c639108 100644 (file)
@@ -10,7 +10,7 @@ Libs=
 PrivateResource=darkplaces-dedicated_private.rc\r
 ResourceIncludes=\r
 MakeIncludes=\r
-Compiler=-Wall -O2 -fno-strict-aliasing -ffast-math -funroll-loops_@@_\r
+Compiler=-Wall -O2 -fno-strict-aliasing -ffast-math -funroll-loops -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES_@@_\r
 CppCompiler=\r
 Linker=-lwinmm -lws2_32_@@_\r
 IsCpp=0\r
index 55e126c..09e5d6a 100644 (file)
@@ -42,8 +42,8 @@ RSC=rc.exe
 # PROP Intermediate_Dir "Release-Dedicated"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /Ox /Ot /Og /Oi /Op /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /Ox /Ot /Og /Oi /Op /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /c\r
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x40c /d "NDEBUG"\r
@@ -69,8 +69,8 @@ LINK32=link.exe
 # PROP Intermediate_Dir "Debug-Dedicated"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /GZ /c\r
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x40c /d "_DEBUG"\r
index 25b9013..e4ed29f 100755 (executable)
@@ -44,7 +44,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
                                UsePrecompiledHeader="0"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
                                UsePrecompiledHeader="0"\r
index cdef255..4ead20d 100755 (executable)
@@ -10,7 +10,7 @@ Libs=C:\Dev-Cpp\SDL\lib
 PrivateResource=darkplaces_private.rc\r
 ResourceIncludes=\r
 MakeIncludes=\r
-Compiler=-Wall -O2 -fno-strict-aliasing -ffast-math -funroll-loops -D_GNU_SOURCE=1 -Dmain=SDL_main_@@__@@_\r
+Compiler=-Wall -O2 -fno-strict-aliasing -ffast-math -funroll-loops -D_GNU_SOURCE=1 -Dmain=SDL_main -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES_@@__@@_\r
 CppCompiler=\r
 Linker=-lwinmm -lws2_32 -luser32 -lgdi32 -lcomctl32 -Wl,--large-address-aware -lmingw32 -lSDLmain -lSDL  -mwindows_@@__@@_\r
 IsCpp=0\r
index 96291cf..6942588 100644 (file)
@@ -42,8 +42,8 @@ RSC=rc.exe
 # PROP Intermediate_Dir "Release-SDL"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /Ox /Ot /Og /Oi /Op /I "SDL/include" /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /Ox /Ot /Og /Oi /Op /I "SDL/include" /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /c\r
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x40c /d "NDEBUG"\r
@@ -69,8 +69,8 @@ LINK32=link.exe
 # PROP Intermediate_Dir "Debug-SDL"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "SDL/include" /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "SDL/include" /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /GZ /c\r
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x40c /d "_DEBUG"\r
index 0a64ccd..d9620e2 100755 (executable)
@@ -44,7 +44,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
                                UsePrecompiledHeader="0"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS"\r
+                               PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
                                UsePrecompiledHeader="0"\r
index 12abbd6..e6a35e9 100644 (file)
@@ -44,7 +44,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D"\r
+                               PreprocessorDefinitions="WIN32;WIN64;_DEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="3"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
                                UsePrecompiledHeader="0"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D"\r
+                               PreprocessorDefinitions="WIN32;WIN64;NDEBUG;_WINDOWS;WIN32_LEAN_AND_MEAN;SUPPORTDIRECTX;SUPPORTD3D;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES"\r
                                RuntimeLibrary="2"\r
                                EnableFunctionLevelLinking="true"\r
                                UsePrecompiledHeader="0"\r
index 4ac2b60..87ca69e 100644 (file)
@@ -10,7 +10,7 @@ Libs=
 PrivateResource=darkplaces_private.rc\r
 ResourceIncludes=\r
 MakeIncludes=\r
-Compiler=-Wall -O2 -fno-strict-aliasing -ffast-math -funroll-loops_@@_\r
+Compiler=-Wall -O2 -fno-strict-aliasing -ffast-math -funroll-loops -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES_@@_\r
 CppCompiler=\r
 Linker=-lwinmm -lws2_32 -luser32 -lgdi32 -ldxguid -ldinput -lcomctl32 -Wl,--large-address-aware_@@_\r
 IsCpp=0\r
index 1151d57..672e25c 100644 (file)
@@ -42,8 +42,8 @@ RSC=rc.exe
 # PROP Intermediate_Dir "Release"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /Ox /Ot /Og /Oi /Op /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c\r
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /Ox /Ot /Og /Oi /Op /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /c\r
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x40c /d "NDEBUG"\r
@@ -69,8 +69,8 @@ LINK32=link.exe
 # PROP Intermediate_Dir "Debug"\r
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c\r
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "WIN32_LEAN_AND_MEAN" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_FILE_OFFSET_BITS=64" /D "__KERNEL_STRICT_NAMES" /YX /FD /GZ /c\r
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x40c /d "_DEBUG"\r
diff --git a/fs.c b/fs.c
index 043bf31..8d505e8 100644 (file)
--- a/fs.c
+++ b/fs.c
                Boston, MA  02111-1307, USA
 */
 
-#ifdef WIN32
-# include <direct.h>
-# include <io.h>
-# include <shlobj.h>
-#endif
-
-// on *x, we MUST include "quakedef.h" before anything that may include IO
-// functions to get _FILE_OFFSET_BITS
-#include "quakedef.h"
-
 #ifdef __APPLE__
 // include SDL for IPHONEOS code
 # include <TargetConditionals.h>
 #include <limits.h>
 #include <fcntl.h>
 
-#ifndef WIN32
+#ifdef WIN32
+# include <direct.h>
+# include <io.h>
+# include <shlobj.h>
+#else
 # include <pwd.h>
 # include <sys/stat.h>
 # include <unistd.h>
 #endif
 
+#include "quakedef.h"
+
 #include "fs.h"
 #include "wad.h"
 
index 8fb3813..c81dcaa 100644 (file)
@@ -187,7 +187,7 @@ OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.
 
 
 # Compilation
-CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D)
+CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES
 CFLAGS_DEBUG=-ggdb
 CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
 CFLAGS_RELEASE=
index f378a9e..12a953e 100644 (file)
@@ -22,12 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifndef QUAKEDEF_H
 #define QUAKEDEF_H
 
-/// on UNIX platforms we need to define this so that video saving does not cause a SIGFSZ (file size) signal when a video clip exceeds 2GB
-#define _FILE_OFFSET_BITS 64
-
-// for cd_linux.c
-#define __KERNEL_STRICT_NAMES
-
 #if defined(__GNUC__) && (__GNUC__ > 2)
 #define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
 #define DP_FUNC_PURE      __attribute__ ((pure))