From 6958f4ce6dc64c0d5a00366ea49db33da9c49e6c Mon Sep 17 00:00:00 2001 From: vscosta Date: Sun, 9 Nov 2014 11:16:24 +0000 Subject: [PATCH] use __WINDOWS__ --- C/save.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/C/save.c b/C/save.c index 03bb74554..839bb61b3 100755 --- a/C/save.c +++ b/C/save.c @@ -254,8 +254,8 @@ open_file(char *my_file, int flag) if (flag == O_RDONLY) { my_file += strlen("/assets/"); AAsset* asset = AAssetManager_open(GLOBAL_assetManager, my_file, AASSET_MODE_UNKNOWN); - if (!asset) - return NULL; + if (!asset) + return NULL; AAsset_close( asset ); return NULL; // usually the file will be compressed, so there is no point in actually trying to open it. } @@ -284,7 +284,7 @@ open_file(char *my_file, int flag) #ifdef undf0 fprintf(errout, "Opened file %s\n", my_file); #endif - return splfild; + return splfild; } static int @@ -1535,7 +1535,7 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac } } } -#if _MSC_VER || defined(__MINGW32__) +#if __WINDOWS__ if ((inpf = Yap_RegistryGetString("startup"))) { if (!((splfild = Sopen_file(inpf, "r")) < 0)) { if ((mode = try_open(inpf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) { @@ -1553,7 +1553,7 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac !(fatts & FILE_ATTRIBUTE_DIRECTORY)) { /* couldn't find it where it was supposed to be, let's try using the executable */ - if (!GetModuleFileName( GetCurrentProcess(), LOCAL_FileNameBuf, YAP_FILENAME_MAX)) { + if (!GetModuleFileName( NULL, LOCAL_FileNameBuf, YAP_FILENAME_MAX)) { /* do nothing */ goto end; }