diff include/SDL_types.h @ 1330:450721ad5436

It's now possible to build SDL without any C runtime at all on Windows, using Visual C++ 2005
author Sam Lantinga <slouken@libsdl.org>
date Mon, 06 Feb 2006 08:28:51 +0000
parents c9b51268668f
children 7f32b9bede06
line wrap: on
line diff
--- a/include/SDL_types.h	Sat Feb 04 22:01:44 2006 +0000
+++ b/include/SDL_types.h	Mon Feb 06 08:28:51 2006 +0000
@@ -25,11 +25,17 @@
 #ifndef _SDL_types_h
 #define _SDL_types_h
 
-/* The number of elements in a table */
-#define SDL_TABLESIZE(table)	(sizeof(table)/sizeof(table[0]))
+#include <sys/types.h>
+#ifdef _MSC_VER
+#include <crtdefs.h>	/* For size_t */
+#endif
+
+/* The number of elements in an array */
+#define SDL_arraysize(array)	(sizeof(array)/sizeof(array[0]))
+#define SDL_TABLESIZE(table)	SDL_arraysize(table)
 
 /* Basic data types */
-typedef enum {
+typedef enum SDL_bool {
 	SDL_FALSE = 0,
 	SDL_TRUE  = 1
 } SDL_bool;
@@ -107,9 +113,4 @@
 
 SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
 
-#undef SDL_COMPILE_TIME_ASSERT
-
-/* General keyboard/mouse state definitions */
-enum { SDL_PRESSED = 0x01, SDL_RELEASED = 0x00 };
-
 #endif