loader/utility.cpp
changeset 705 a1001281dcb1
parent 608 30b546cc4e03
child 747 9563de0165f7
     1.1 --- a/loader/utility.cpp	Fri May 14 00:34:36 2010 -0500
     1.2 +++ b/loader/utility.cpp	Fri May 14 00:34:56 2010 -0500
     1.3 @@ -270,7 +270,7 @@
     1.4  {
     1.5  #if defined _WIN32
     1.6  	return _fullpath(buffer, path, maxlength) != NULL;
     1.7 -#elif defined __linux__
     1.8 +#elif defined __linux__ || defined __APPLE__
     1.9  	assert(maxlength >= PATH_MAX);
    1.10  	return realpath(path, buffer) != NULL;
    1.11  #endif
    1.12 @@ -289,7 +289,7 @@
    1.13  		mm_GetPlatformError(buffer, maxlength);
    1.14  		return NULL;
    1.15  	}
    1.16 -#elif defined __linux__
    1.17 +#elif defined __linux__ || defined __APPLE__
    1.18  	lib = dlopen(path, RTLD_NOW);
    1.19  
    1.20  	if (lib == NULL)
    1.21 @@ -307,7 +307,7 @@
    1.22  {
    1.23  #if defined _WIN32
    1.24  	return GetProcAddress((HMODULE)lib, name);
    1.25 -#elif defined __linux__
    1.26 +#elif defined __linux__ || defined __APPLE__
    1.27  	return dlsym(lib, name);
    1.28  #endif
    1.29  }
    1.30 @@ -317,7 +317,7 @@
    1.31  {
    1.32  #if defined _WIN32
    1.33  	FreeLibrary((HMODULE)lib);
    1.34 -#else
    1.35 +#elif defined __linux__ || defined __APPLE__
    1.36  	dlclose(lib);
    1.37  #endif
    1.38  }
    1.39 @@ -333,7 +333,7 @@
    1.40  		return false;
    1.41  	HMODULE dll = (HMODULE)mem.AllocationBase;
    1.42  	GetModuleFileName(dll, (LPTSTR)buffer, maxlength);
    1.43 -#elif defined __linux__
    1.44 +#elif defined __linux__ || defined __APPLE__
    1.45  	Dl_info info;
    1.46  	if (!dladdr(pAddr, &info))
    1.47  		return false;