Lee Thomason 13 лет назад
Родитель
Сommit
e9699e6cd2
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      xmltest.cpp

+ 8 - 2
xmltest.cpp

@@ -1,16 +1,18 @@
 #include "tinyxml2.h"
 
-#include <direct.h>
 #include <cstdlib>
 #include <cstring>
 #include <ctime>
 
 #if defined( _MSC_VER )
+	#include <direct.h>		// _mkdir
 	#include <crtdbg.h>
 	#define WIN32_LEAN_AND_MEAN
 	#include <windows.h>
 	_CrtMemState startMemState;
 	_CrtMemState endMemState;
+#else
+	#include <sys/stat.h>	// mkdir
 #endif
 
 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.
 	#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" );
 	if ( !fp ) {