Showing the changes to src/core/chuck_parse.cpp (1 of 14 files). Show all
Unified · Split
| @@ -39,8 +39,14 @@ · 38 unmodified lines | ||
| 39 | 39 | #endif |
| 40 | 40 | |
| 41 | 41 | #ifdef __PLATFORM_WIN32__ |
| 42 | −#include <windows.h> // for win32_tmpfile() | |
| 43 | −#endif | |
| 42 | +#ifndef __CHUNREAL_ENGINE__ | |
| 43 | + #include <windows.h> // for win32_tmpfile() | |
| 44 | +#else | |
| 45 | + // 1.5.0.0 (ge) | #chunreal | |
| 46 | + // unreal engine on windows disallows including windows.h | |
| 47 | + #include "Windows/MinWindows.h" | |
| 48 | +#endif // #ifndef __CHUNREAL_ENGINE__ | |
| 49 | +#endif // #ifdef __PLATFORM_WIN32__ | |
| 44 | 50 | |
| 45 | 51 | using namespace std; |
| 46 | 52 | |
| @@ -76,44 +82,53 @@ FILE * open_cat_ck( c_str fname ) · 29 unmodified lines | ||
| 76 | 82 | } |
| 77 | 83 | #endif // __ANDROID__ |
| 78 | 84 | |
| 79 | − FILE * fd = NULL; | |
| 80 | − if( !(fd = fopen( fname, "rb" )) ) | |
| 85 | + FILE * fd = fopen(fname, "rb"); | |
| 86 | + if( !fd ) | |
| 87 | + { | |
| 81 | 88 | if( !strstr( fname, ".ck" ) && !strstr( fname, ".CK" ) ) |
| 82 | 89 | { |
| 83 | 90 | strcat( fname, ".ck" ); |
| 84 | 91 | fd = fopen( fname, "rb" ); |
| 85 | 92 | } |
| 93 | + } | |
| 86 | 94 | return fd; |
| 87 | 95 | } |
| 88 | 96 | |
| 89 | 97 | |
| 90 | 98 | |
| 99 | + | |
| 91 | 100 | //----------------------------------------------------------------------------- |
| 92 | 101 | // name: win32_tmpfile() |
| 93 | 102 | // desc: replacement for broken tmpfile() on Windows Vista + 7 |
| 94 | 103 | //----------------------------------------------------------------------------- |
| 95 | 104 | #ifdef __PLATFORM_WIN32__ |
| 96 | − | |
| 97 | −#include <windows.h> | |
| 98 | − | |
| 99 | 105 | FILE *win32_tmpfile() |
| 100 | 106 | { |
| 101 | 107 | char tmp_path[MAX_PATH]; |
| 102 | 108 | char file_path[MAX_PATH]; |
| 103 | 109 | FILE * file = NULL; |
| 104 | 110 | |
| 105 | − if(GetTempPath(256, tmp_path) == 0) | |
| 111 | +#ifndef __CHUNREAL_ENGINE__ | |
| 112 | + if( GetTempPath(256, tmp_path) == 0 ) | |
| 113 | +#else | |
| 114 | + // 1.5.0.0 (ge) | #chunreal explicit call ASCII version | |
| 115 | + if( GetTempPathA(256, tmp_path) == 0 ) | |
| 116 | +#endif | |
| 106 | 117 | return NULL; |
| 107 | 118 | |
| 108 | − if(GetTempFileName(tmp_path, "mA", 0, file_path) == 0) | |
| 119 | +#ifndef __CHUNREAL_ENGINE__ | |
| 120 | + if( GetTempFileName(tmp_path, "mA", 0, file_path) == 0 ) | |
| 121 | +#else | |
| 122 | + // 1.5.0.0 (ge) | #chunreal explicit call ASCII version | |
| 123 | + if( GetTempFileNameA(tmp_path, "mA", 0, file_path) == 0 ) | |
| 124 | +#endif | |
| 109 | 125 | return NULL; |
| 110 | 126 | |
| 111 | − file = fopen(file_path, "wb+D"); | |
| 127 | + file = fopen( file_path, "wb+D" ); | |
| 112 | 128 | |
| 113 | 129 | return file; |
| 114 | 130 | } |
| 115 | − | |
| 116 | −#endif | |
| 131 | +#endif // #ifdef __PLATFORM_WIN32__ | |
| 117 | 132 | |
| 118 | 133 | |
| 119 | 134 | |