summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Schultz <kschultz@freedesktop.org>2005-05-24 22:16:27 +0000
committerKarl Schultz <kschultz@freedesktop.org>2005-05-24 22:16:27 +0000
commit6b5afb003645d2cbaabf7d9c0733f1f7891cb0a0 (patch)
tree1eecf82d30371eb96d7be95baeed9f5bba56d42f
parent89bf62cd497f5f667ff68f529af1bb5e39915ab4 (diff)
Cleanup some Windows junk.
-rw-r--r--src/mesa/main/glheader.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 0b1c16d244..f8ea238f42 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -75,10 +75,12 @@
#include "conf.h"
#endif
-
/* Get typedefs for uintptr_t and friends */
-#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP)
+#if defined(_WIN32)
#include <BaseTsd.h>
+#if _MSC_VER == 1200
+typedef UINT_PTR uintptr_t;
+#endif
#else
#include <inttypes.h>
#endif
@@ -122,16 +124,6 @@
/* XXX why is this here?
* It should probaby be somewhere in src/mesa/drivers/windows/
*/
-/* compatibility guard so we don't need to change client code */
-#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_WINDEF_H) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP)
-typedef INT_PTR (GLAPIENTRY *PROC)();
-typedef unsigned long COLORREF;
-#endif
-
-
-/* XXX why is this here?
- * It should probaby be somewhere in src/mesa/drivers/windows/
- */
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WINGDI_H) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(BUILD_FOR_SNAP)
# define WGL_FONT_LINES 0
# define WGL_FONT_POLYGONS 1
@@ -277,6 +269,18 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
# define __builtin_expect(x, y) x
#endif
+/* Windows does not have the ffs() function */
+#if defined(_WIN32) && !defined(__MINGW32__)
+int INLINE ffs(int value)
+{
+ int bit;
+ if (value == 0)
+ return 0;
+ for (bit=1; !(value & 1); bit++)
+ value >>= 1;
+ return bit;
+}
+#endif
#include "config.h"