Add macros to generate CreateNewScreen entrypoint.
authorKristian Høgsberg <krh@redhat.com>
Tue, 1 May 2007 01:05:10 +0000 (21:05 -0400)
committerKristian Høgsberg <krh@redhat.com>
Fri, 5 Oct 2007 04:12:30 +0000 (00:12 -0400)
include/GL/internal/dri_interface.h
src/glx/x11/dri_glx.c

index a1a29409b117aca143776afc5e9a1f9cf26b7bb1..97edec0ca9d9caeec8bcb53fa5177296d8af8a65 100644 (file)
@@ -93,11 +93,28 @@ typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
 /*@}*/
 
 
+/**
+ * Macros for building symbol and strings.  Standard CPP two step...
+ */
+
+#define __DRI_REAL_STRINGIFY(x) # x
+#define __DRI_STRINGIFY(x) __DRI_REAL_STRINGIFY(x)
+#define __DRI_REAL_MAKE_VERSION(name, version) name ## _ ## version
+#define __DRI_MAKE_VERSION(name, version) __DRI_REAL_MAKE_VERSION(name, version)
+
+#define __DRI_CREATE_NEW_SCREEN \
+    __DRI_MAKE_VERSION(__driCreateNewScreen, __DRI_INTERFACE_VERSION)
+
+#define __DRI_CREATE_NEW_SCREEN_STRING \
+    __DRI_STRINGIFY(__DRI_CREATE_NEW_SCREEN)
+
 /**
  * \name Functions and data provided by the driver.
  */
 /*@{*/
 
+#define __DRI_INTERFACE_VERSION 20070105
+
 typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
     __DRIscreen *psc, const __GLcontextModes * modes,
     const __DRIversion * ddx_version, const __DRIversion * dri_version,
@@ -106,7 +123,8 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
     const __DRIinterfaceMethods * interface,
     __GLcontextModes ** driver_modes);
 typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
-extern CREATENEWSCREENFUNC __driCreateNewScreen_20070105;
+extern CREATENEWSCREENFUNC __DRI_CREATE_NEW_SCREEN;
+
 
 
 /**
index d68addaa9f476ad9d1259716e6a954b3da60b87a..c02f105611c9f620abea19f821674ccc39a36e2c 100644 (file)
@@ -167,11 +167,8 @@ ExtractDir(int index, const char *paths, int dirLen, char *dir)
  * The version of the last incompatible loader/driver inteface change is
  * appended to the name of the \c __driCreateNewScreen function.  This
  * prevents loaders from trying to load drivers that are too old.
- * 
- * \todo
- * Create a macro or something so that this is automatically updated.
  */
-static const char createNewScreenName[] = "__driCreateNewScreen_20070105";
+static const char createNewScreenName[] = __DRI_CREATE_NEW_SCREEN_STRING;
 
 
 /**