Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11video.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 | c0a74f199ecf |
children | 8d9bb0cf2c2a |
comparison
equal
deleted
inserted
replaced
1401:1819fd069e89 | 1402:d910939febfa |
---|---|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 |
19 Sam Lantinga | 19 Sam Lantinga |
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 #include "SDL_config.h" | |
22 | 23 |
23 /* X11 based SDL video driver implementation. | 24 /* X11 based SDL video driver implementation. |
24 Note: This implementation does not currently need X11 thread locking, | 25 Note: This implementation does not currently need X11 thread locking, |
25 since the event thread uses a separate X connection and any | 26 since the event thread uses a separate X connection and any |
26 additional locking necessary is handled internally. However, | 27 additional locking necessary is handled internally. However, |
264 | 265 |
265 /* Find out what class name we should use */ | 266 /* Find out what class name we should use */ |
266 static char *get_classname(char *classname, int maxlen) | 267 static char *get_classname(char *classname, int maxlen) |
267 { | 268 { |
268 char *spot; | 269 char *spot; |
269 #if defined(linux) || defined(__FreeBSD__) | 270 #if defined(__LINUX__) || defined(__FREEBSD__) |
270 char procfile[1024]; | 271 char procfile[1024]; |
271 char linkfile[1024]; | 272 char linkfile[1024]; |
272 int linksize; | 273 int linksize; |
273 #endif | 274 #endif |
274 | 275 |
278 SDL_strlcpy(classname, spot, maxlen); | 279 SDL_strlcpy(classname, spot, maxlen); |
279 return classname; | 280 return classname; |
280 } | 281 } |
281 | 282 |
282 /* Next look at the application's executable name */ | 283 /* Next look at the application's executable name */ |
283 #if defined(linux) || defined(__FreeBSD__) | 284 #if defined(__LINUX__) || defined(__FREEBSD__) |
284 #if defined(linux) | 285 #if defined(__LINUX__) |
285 SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid()); | 286 SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid()); |
286 #elif defined(__FreeBSD__) | 287 #elif defined(__FREEBSD__) |
287 SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", getpid()); | 288 SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", getpid()); |
288 #else | 289 #else |
289 #error Where can we find the executable name? | 290 #error Where can we find the executable name? |
290 #endif | 291 #endif |
291 linksize = readlink(procfile, linkfile, sizeof(linkfile)-1); | 292 linksize = readlink(procfile, linkfile, sizeof(linkfile)-1); |
297 } else { | 298 } else { |
298 SDL_strlcpy(classname, linkfile, maxlen); | 299 SDL_strlcpy(classname, linkfile, maxlen); |
299 } | 300 } |
300 return classname; | 301 return classname; |
301 } | 302 } |
302 #endif /* linux */ | 303 #endif /* __LINUX__ */ |
303 | 304 |
304 /* Finally use the default we've used forever */ | 305 /* Finally use the default we've used forever */ |
305 SDL_strlcpy(classname, "SDL_App", maxlen); | 306 SDL_strlcpy(classname, "SDL_App", maxlen); |
306 return classname; | 307 return classname; |
307 } | 308 } |