aboutsummaryrefslogtreecommitdiff
path: root/emulators/mupen64-gln64/files/patch-winlnxdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/mupen64-gln64/files/patch-winlnxdefs.h')
-rw-r--r--emulators/mupen64-gln64/files/patch-winlnxdefs.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/emulators/mupen64-gln64/files/patch-winlnxdefs.h b/emulators/mupen64-gln64/files/patch-winlnxdefs.h
new file mode 100644
index 000000000000..2ff16f96000e
--- /dev/null
+++ b/emulators/mupen64-gln64/files/patch-winlnxdefs.h
@@ -0,0 +1,24 @@
+--- winlnxdefs.h.orig Thu Oct 16 01:01:08 2003
++++ winlnxdefs.h Wed Sep 22 05:32:54 2004
+@@ -30,7 +30,9 @@
+ #ifndef WINLNXDEFS_H
+ #define WINLNXDEFS_H
+
++#ifndef __FreeBSD__
+ #include <features.h> // we want GNU extensions
++#endif
+ #include <dlfcn.h>
+ #include <errno.h>
+ #include <limits.h> // PATH_MAX
+@@ -113,7 +115,11 @@
+ {
+ fprintf( stderr, "(WW) Couldn't get path of .so, trying to get emulator's path\n" );
+ #endif // __USE_GNU
++#ifndef __FreeBSD__
+ if (readlink( "/proc/self/exe", path, PATH_MAX ) == -1)
++#else
++ if (readlink( "/proc/curproc/file", path, PATH_MAX ) == -1)
++#endif // __FreeBSD__
+ {
+ fprintf( stderr, "(WW) readlink() /proc/self/exe failed: %s\n", strerror( errno ) );
+ path[0] = '.';