Platform depedency with fopen
This commit is contained in:
parent
5f717f4427
commit
c6f27e1e69
7
stable.c
7
stable.c
|
@ -292,7 +292,14 @@ int st_store(STD s_table){
|
|||
FILE *out; /* The target file*/
|
||||
int i;
|
||||
|
||||
/* Windows does not like fopen, and fopen_s is Windows-only. This will ensure the
|
||||
* use of the proper function call if PLATYPUS is being built on a non-windows system
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
if(fopen_s(&out, ST_FILE_NAME, "w+") != 0)
|
||||
#else
|
||||
if ((out = fopen(ST_FILE_NAME, "w+")) == NULL)
|
||||
#endif
|
||||
return -1; /* Can't open file, stop. */
|
||||
|
||||
fprintf(out, "%d", s_table.st_size);
|
||||
|
|
Loading…
Reference in New Issue