Mercurial > sdl-ios-xcode
diff src/file/SDL_rwops.c @ 1402:d910939febfa
Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 21 Feb 2006 08:46:50 +0000 |
parents | c71e05b4dc2e |
children | 47bf1767c4ca |
line wrap: on
line diff
--- a/src/file/SDL_rwops.c Tue Feb 21 08:34:45 2006 +0000 +++ b/src/file/SDL_rwops.c Tue Feb 21 08:46:50 2006 +0000 @@ -19,6 +19,7 @@ Sam Lantinga slouken@libsdl.org */ +#include "SDL_config.h" /* This file provides a general interface for SDL to read and write data sources. It can easily be extended to files, memory, etc. @@ -147,14 +148,14 @@ } /* Functions to create SDL_RWops structures from various data sources */ -#ifdef WIN32 +#ifdef __WIN32__ /* Aggh. You can't (apparently) open a file in an application and read from it in a DLL. */ static int in_sdl = 0; #endif -#ifdef macintosh +#ifdef __MACOS__ /* * translate unix-style slash-separated filename to mac-style colon-separated * name; return malloced string @@ -196,7 +197,7 @@ *dst++ = '\0'; return path; } -#endif /* macintosh */ +#endif /* __MACOS__ */ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) { @@ -204,7 +205,7 @@ #ifdef HAVE_STDIO_H FILE *fp; -#ifdef macintosh +#ifdef __MACOS__ { char *mpath = unix_to_mac(file); fp = fopen(mpath, mode); @@ -216,7 +217,7 @@ if ( fp == NULL ) { SDL_SetError("Couldn't open %s", file); } else { -#ifdef WIN32 +#ifdef __WIN32__ in_sdl = 1; rwops = SDL_RWFromFP(fp, 1); in_sdl = 0; @@ -233,7 +234,7 @@ { SDL_RWops *rwops = NULL; -#ifdef WIN32 +#ifdef __WIN32__ if ( ! in_sdl ) { /* It's when SDL and the app are compiled with different C runtimes */ SDL_SetError("You can't pass a FILE pointer to a DLL (?)");