History

Add tmpfile() Android implementation

Andriy Kunitsyn committed 5 years ago

Commit 8adc8f21 parent 427ed663 files · +145 −0Browse files

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

Unified · Split

src/core/chuck_parse.cpp+21−0
@@ -94,6 +94,23 @@ FILE *win32_tmpfile() · 93 unmodified lines
94 94
95 95
96 96
97//-----------------------------------------------------------------------------
98// name: android_tmpfile()
99// desc: replacement for broken tmpfile() on Android
100//-----------------------------------------------------------------------------
101#ifdef __ANDROID__
102
103#include "chuck_android.h"
104
105FILE *android_tmpfile()
106{
107 return ChuckAndroid::getTemporaryFile();
108}
109
110#endif
111
112
113
97//-----------------------------------------------------------------------------114//-----------------------------------------------------------------------------
98// name: chuck_parse()115// name: chuck_parse()
99// desc: ...116// desc: ...
@@ -118,9 +135,13 @@ t_CKBOOL chuck_parse( c_constr fname, FILE * fd, c_constr code ) · 18 unmodified lines
118 // generate temp file135 // generate temp file
119#ifdef __PLATFORM_WIN32__136#ifdef __PLATFORM_WIN32__
120 fd = win32_tmpfile();137 fd = win32_tmpfile();
138#elif defined (__ANDROID__)
139 fd = android_tmpfile();
121#else140#else
122 fd = tmpfile();141 fd = tmpfile();
123#endif142#endif
143 // on some systems, tmpfile() can return NULL
144 if( !fd ) { EM_error2( 0, "unable to create temp file" ); return FALSE; }
124 // flag it to close145 // flag it to close
125 clo = TRUE;146 clo = TRUE;
126 // write147 // write

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