added support for SunOS
This commit is contained in:
parent
08b7ee02a3
commit
f3c700e059
@ -12,6 +12,7 @@ Supported platforms:
|
|||||||
- Android
|
- Android
|
||||||
- QNX Neutrino
|
- QNX Neutrino
|
||||||
- FreeBSD
|
- FreeBSD
|
||||||
|
- SunOS
|
||||||
|
|
||||||
Just drop `whereami.h` and `whereami.c` into your build and get started. (see
|
Just drop `whereami.h` and `whereami.c` into your build and get started. (see
|
||||||
also [customizing compilation])
|
also [customizing compilation])
|
||||||
|
@ -158,7 +158,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
|||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__linux__) || defined(__CYGWIN__)
|
#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -170,8 +170,12 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#if !defined(WAI_PROC_SELF_EXE)
|
#if !defined(WAI_PROC_SELF_EXE)
|
||||||
|
#if defined(__sun)
|
||||||
|
#define WAI_PROC_SELF_EXE "/proc/self/path/a.out"
|
||||||
|
#else
|
||||||
#define WAI_PROC_SELF_EXE "/proc/self/exe"
|
#define WAI_PROC_SELF_EXE "/proc/self/exe"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
WAI_FUNCSPEC
|
WAI_FUNCSPEC
|
||||||
int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length)
|
int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length)
|
||||||
@ -217,8 +221,12 @@ int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(WAI_PROC_SELF_MAPS)
|
#if !defined(WAI_PROC_SELF_MAPS)
|
||||||
|
#if defined(__sun)
|
||||||
|
#define WAI_PROC_SELF_MAPS "/proc/self/map"
|
||||||
|
#else
|
||||||
#define WAI_PROC_SELF_MAPS "/proc/self/maps"
|
#define WAI_PROC_SELF_MAPS "/proc/self/maps"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__ANDROID__) || defined(ANDROID)
|
#if defined(__ANDROID__) || defined(ANDROID)
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user