fix up mkdir on win vs. *nix

This commit is contained in:
Lee Thomason 2012-07-25 12:24:23 -07:00
parent ef1c69cf15
commit e9699e6cd2
1 changed files with 8 additions and 2 deletions

View File

@ -1,16 +1,18 @@
#include "tinyxml2.h" #include "tinyxml2.h"
#include <direct.h>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#if defined( _MSC_VER ) #if defined( _MSC_VER )
#include <direct.h> // _mkdir
#include <crtdbg.h> #include <crtdbg.h>
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
_CrtMemState startMemState; _CrtMemState startMemState;
_CrtMemState endMemState; _CrtMemState endMemState;
#else
#include <sys/stat.h> // mkdir
#endif #endif
using namespace tinyxml2; using namespace tinyxml2;
@ -156,7 +158,11 @@ int main( int /*argc*/, const char ** /*argv*/ )
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated. #pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
#endif #endif
mkdir( "resources/out/" ); #if defined(_MSC_VER)
_mkdir( "resources/out/" );
#else
mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
#endif
FILE* fp = fopen( "resources/dream.xml", "r" ); FILE* fp = fopen( "resources/dream.xml", "r" );
if ( !fp ) { if ( !fp ) {