forked from 0ad/0ad
janwas
4be0fe18a0
. major compat fixes for interoperation with wxw. . add crashlog_sender (modified version of debgrpt wxw sample). compiles but untested, will be changed heavily further improvements: . wposix no longer declares CRT functions. instead, use CRT headers.. but don't allow their (incorrect/non-POSIX) declarations to propagate to users. . split up win.cpp into wstartup, wutil, winit . extern "C" -> EXTERN_C . move sdl.* to lib/external_libraries and add png.h+zlib.h (fixes for and include of the library) This was SVN commit r5028.
29 lines
917 B
C
29 lines
917 B
C
/**
|
|
* see rationale in wposix.h.
|
|
* we need to have CRT functions (e.g. _open) declared correctly
|
|
* but must prevent POSIX functions (e.g. open) from being declared -
|
|
* they would conflict with our wrapper function.
|
|
*
|
|
* since the headers only declare POSIX stuff #if !__STDC__, a solution
|
|
* would be to set this flag temporarily. note that MSDN says that
|
|
* such predefined macros cannot be redefined nor may they change during
|
|
* compilation, but this works and seems to be a fairly common practice.
|
|
**/
|
|
|
|
// undefine include guards set by no_crt_posix
|
|
#if defined(_INC_IO) && defined(WPOSIX_DEFINED_IO_INCLUDE_GUARD)
|
|
# undef _INC_IO
|
|
#endif
|
|
#if defined(_INC_DIRECT) && defined(WPOSIX_DEFINED_DIRECT_INCLUDE_GUARD)
|
|
# undef _INC_DIRECT
|
|
#endif
|
|
|
|
|
|
#define __STDC__ 1
|
|
|
|
#include <io.h> // _open etc.
|
|
#include <direct.h> // _getcwd, _rmdir
|
|
|
|
#undef __STDC__
|
|
#define __STDC__ 0
|