History

a bit batch of #chunreal refactor

Ge Wang committed 3 years ago

Commit 9aac3a41 parent a46220614 files · +195 −124Browse files

Showing the changes to src/core/chuck_parse.cpp (1 of 14 files). Show all

Unified · Split

src/core/chuck_parse.cpp+27−12
@@ -39,8 +39,14 @@ · 38 unmodified lines
3939 #endif
4040
4141 #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__
4450
4551 using namespace std;
4652
@@ -76,44 +82,53 @@ FILE * open_cat_ck( c_str fname ) · 29 unmodified lines
7682 }
7783 #endif // __ANDROID__
7884
79− FILE * fd = NULL;
80− if( !(fd = fopen( fname, "rb" )) )
85+ FILE * fd = fopen(fname, "rb");
86+ if( !fd )
87+ {
8188 if( !strstr( fname, ".ck" ) && !strstr( fname, ".CK" ) )
8289 {
8390 strcat( fname, ".ck" );
8491 fd = fopen( fname, "rb" );
8592 }
93+ }
8694 return fd;
8795 }
8896
8997
9098
99+
91100 //-----------------------------------------------------------------------------
92101 // name: win32_tmpfile()
93102 // desc: replacement for broken tmpfile() on Windows Vista + 7
94103 //-----------------------------------------------------------------------------
95104 #ifdef __PLATFORM_WIN32__
96−
97−#include <windows.h>
98−
99105 FILE *win32_tmpfile()
100106 {
101107 char tmp_path[MAX_PATH];
102108 char file_path[MAX_PATH];
103109 FILE * file = NULL;
104110
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
106117 return NULL;
107118
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
109125 return NULL;
110126
111− file = fopen(file_path, "wb+D");
127+ file = fopen( file_path, "wb+D" );
112128
113129 return file;
114130 }
115−
116−#endif
131+#endif // #ifdef __PLATFORM_WIN32__
117132
118133
119134

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t