diff --git a/api/graphics2.h b/api/graphics2.h index c904fb22a4..327d851db8 100644 --- a/api/graphics2.h +++ b/api/graphics2.h @@ -17,12 +17,7 @@ extern void boinc_app_key_release(int, int); // extern void boinc_graphics_loop(int, char**); extern void* boinc_graphics_make_shmem(char*, int); - -#ifdef USE_FILE_MAPPED_SHMEM -// Use boinc_graphics_make_shmem() instead of boinc_graphics_get_shmem() -#else extern void* boinc_graphics_get_shmem(char*); -#endif // Implementation stuff // diff --git a/api/graphics2_util.C b/api/graphics2_util.C index cee186ec73..4250c11fc1 100644 --- a/api/graphics2_util.C +++ b/api/graphics2_util.C @@ -21,6 +21,7 @@ static void get_shmem_name(char* prog_name, char* shmem_name) { sprintf(shmem_name, "boinc_%s_%d", prog_name, aid.slot); } #else +#ifndef USE_FILE_MAPPED_SHMEM static key_t get_shmem_name(char* prog_name) { char cwd[256], path[256]; boinc_getcwd(cwd); @@ -28,6 +29,7 @@ static key_t get_shmem_name(char* prog_name) { return ftok(path, 2); } #endif +#endif void* boinc_graphics_make_shmem(char* prog_name, int size) { #ifdef _WIN32 @@ -66,7 +68,7 @@ void* boinc_graphics_get_shmem(char* prog_name) { void* p; #ifdef USE_FILE_MAPPED_SHMEM struct stat sbuf; - retval = stat(GFX_MMAPPED_FILE_NAME, &sbuf); + int retval = stat(GFX_MMAPPED_FILE_NAME, &sbuf); if (retval == 0) { retval = create_shmem(GFX_MMAPPED_FILE_NAME, sbuf.st_size, &p); }