diff --git a/source/lib/posix.h b/source/lib/posix.h index 9cc24876bb..efe157bd19 100755 --- a/source/lib/posix.h +++ b/source/lib/posix.h @@ -16,6 +16,8 @@ // Jan.Wassenberg@stud.uni-karlsruhe.de // http://www.stud.uni-karlsruhe.de/~urkt/ +#include + #ifndef _WIN32 #include @@ -41,6 +43,7 @@ #ifndef __POSIX_H__ #define __POSIX_H__ + #include #include @@ -64,11 +67,6 @@ typedef unsigned short u16_t; // // -#ifndef _SIZE_T_DEFINED // compatibility with VC stdlib.h -#define _SIZE_T_DEFINED -typedef unsigned long size_t; -#endif - typedef long ssize_t; diff --git a/source/lib/res.h b/source/lib/res.h index 32e4dc36ea..ad68f3676a 100755 --- a/source/lib/res.h +++ b/source/lib/res.h @@ -21,6 +21,11 @@ #include "types.h" +// the following are internal to the resource manager, +// but are required for the HDATA definition +// (which is passed around to modules that create handles). +// we don't want to waste memory or fragment the handle data +// by splitting into internal/external // handle type (for 'type safety' - can't use a texture handle as a sound) diff --git a/source/lib/time.cpp b/source/lib/time.cpp index 4905cc0160..1c3ab35098 100755 --- a/source/lib/time.cpp +++ b/source/lib/time.cpp @@ -19,10 +19,6 @@ #include #include -#ifdef _WIN32 -#include "win.h" -#endif - #include "ia32.h" #include "posix.h" #include "detect.h" @@ -30,6 +26,11 @@ #include "types.h" #include "misc.h" +#ifdef _WIN32 +#include "win.h" +#endif + + // high resolution (> 1 µs) timestamp [s], starting at or near 0 s. // diff --git a/source/lib/win.h b/source/lib/win.h index 6f9037f583..036420d0b1 100755 --- a/source/lib/win.h +++ b/source/lib/win.h @@ -1,7 +1,9 @@ -// sockets already defined by posix.h -#ifdef __POSIX_H__ +#ifndef __WIN_H__ +#define __WIN_H__ + +// Win32 socket decls aren't portable (e.g. problems with socklen_t) +// => skip winsock.h; posix.h should be used instead #define _WINSOCKAPI_ -#endif #define WIN32_LEAN_AND_MEAN #define VC_EXTRALEAN @@ -76,3 +78,5 @@ extern int _close(int); extern __declspec(dllimport) int __stdcall WSAStartup(WORD, char*); #endif } + +#endif // #ifndef __WIN_H__ \ No newline at end of file diff --git a/source/ps/CStr.h b/source/ps/CStr.h index ffa3229fea..62fdf93f19 100755 --- a/source/ps/CStr.h +++ b/source/ps/CStr.h @@ -35,7 +35,7 @@ More Info: #include "Prometheus.h" #include // Used for basic string functionality #include -#include +#include "win.h" // REMOVEME #include // TCHAR of course #include using namespace std; diff --git a/source/vc7/ps.vcproj b/source/vc7/ps.vcproj index 6c584e5a6d..58357022b0 100755 --- a/source/vc7/ps.vcproj +++ b/source/vc7/ps.vcproj @@ -38,16 +38,16 @@ Name="VCCustomBuildTool"/> + AllOptions="/NOLOGO /OUT:"..\..\binaries/ps_dbg.vc7.exe" /INCREMENTAL /DEBUG /PDB:"..\..\binaries/ps_dbg.vc7.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /ENTRY:"entry" /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/> @@ -93,17 +93,18 @@ Name="VCCustomBuildTool"/> + AllOptions="/NOLOGO /OUT:"..\..\binaries/ps.vc7.exe" /INCREMENTAL:NO /DEBUG /PDB:"..\..\binaries/ps.vc7.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /ENTRY:"entry" /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/>