diff options
author | Steven Noonan <steven@uplinklabs.net> | 2009-10-13 03:16:21 -0700 |
---|---|---|
committer | Steven Noonan <steven@uplinklabs.net> | 2009-10-13 06:23:13 -0700 |
commit | 18bf8b6c7b04fe232d240e6677f39de09d7a590f (patch) | |
tree | 3d5b9af2e682defa6104867cc4e85e020dd44e80 /crawl-ref/source/initfile.cc | |
parent | 997a4469a2022461f5fe011bd7d0843d6dd6c5de (diff) | |
download | crawl-ref-18bf8b6c7b04fe232d240e6677f39de09d7a590f.tar.gz crawl-ref-18bf8b6c7b04fe232d240e6677f39de09d7a590f.zip |
initfile.cc: use new platform identification macros in find_executable_path()
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r-- | crawl-ref/source/initfile.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index fe3d8adcb4..5a572246b0 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -3501,14 +3501,14 @@ std::string find_executable_path() // Faster than a memset, and counts as a null-terminated string! tempPath[0] = 0; -#if defined ( _MSC_VER ) +#if defined ( TARGET_OS_WINDOWS ) GetModuleFileName ( NULL, tempPath, sizeof(tempPath) ); -#elif defined ( __linux__ ) +#elif defined ( TARGET_OS_LINUX ) const ssize_t rsize = readlink("/proc/self/exe", tempPath, sizeof(tempPath) - 1); if (rsize > 0) tempPath[rsize] = 0; -#elif defined ( __MACH__ ) +#elif defined ( TARGET_OS_MACOSX ) strncpy ( tempPath, NXArgv[0], sizeof(tempPath) ); #else // We don't know how to find the executable's path on this OS. |