]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
More MacOS X stuff. The correct test for MacOS X in preprocessor seems to
authorknghtbrd <knghtbrd@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 31 Dec 2003 18:03:49 +0000 (18:03 +0000)
committerknghtbrd <knghtbrd@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 31 Dec 2003 18:03:49 +0000 (18:03 +0000)
be defined(__APPLE__) && defined(__MACH__).  MacOS X has strl functions,
so don't bother compiling them.  Also, the correct name and location of
libGL for X11 on a Mac is /usr/X11R6/lib/libGL.1.dylib.  Compiles with one
warning caused by use of dlfcn.h (an emulation of the dynamic ELF object
loader which complains that you really should be using the Mach-O dylib
API instead.)

Compiled with gcc 3.1 (use gcc_select) on MacOS X 10.3 with X11 and the
Xcode Tools installed.  Makefile changes were: null sound/cd, removal of
-lxf86dga from the GLX build, and replacing -ggdb in both places with
plain old -g (someone at Apple needs a LARTing for this...)  SHOULD work
with 10.2 provided that you have developer tools, X11 with devel stuff,
and the dlfcn emulation package from fink.  I can't promise meaningful
support for anything but Panther, sorry.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3770 d7cf8633-e32d-0410-b094-e92efae38249

common.c
vid_glx.c

index a82d3c426591a9b61b179bcc26ec8ad93eb1dcb7..95043325e40be71f476bcb99c8220018dee5c347 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1121,7 +1121,7 @@ char *SearchInfostring(const char *infostring, const char *key)
 
 
 // Most (all?) BSDs already have them
-#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
+#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !(defined(__APPLE__) && defined(__MACH__))
 
 size_t
 strlcat(char *dst, const char *src, size_t siz)
index b175bbcb612c9438947291e670a39cc8c3939a4f..ec9a998b71e0ea795daf4b070f32a2329972c593 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <X11/cursorfont.h>
 
 #include <X11/extensions/XShm.h>
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__MACH__)
 #include <X11/extensions/xf86dga.h>
 #endif
 #include <X11/extensions/xf86vmode.h>
@@ -683,7 +683,11 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        int MajorVersion, MinorVersion;
        const char *drivername;
 
-       drivername = "libGL.so.1";
+#if defined(__APPLE__) && defined(__MACH__)
+       drivername = "/usr/X11R6/lib/libGL.1.dylib";
+#else
+       drivername = "libGL.so.1"
+#endif
        i = COM_CheckParm("-gl_driver");
        if (i && i < com_argc - 1)
                drivername = com_argv[i + 1];