Merge branch 'mesa_7_7_branch'
[mesa.git] / include / EGL / eglplatform.h
1 /* -*- mode: c; tab-width: 8; -*- */
2 /* vi: set sw=4 ts=8: */
3 /* Platform-specific types and definitions for egl.h */
4
5 #ifndef __eglplatform_h_
6 #define __eglplatform_h_
7
8 /* Windows calling convention boilerplate */
9 #if (defined(WIN32) || defined(_WIN32_WCE))
10 #ifndef WIN32_LEAN_AND_MEAN
11 #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
12 #endif
13 #include <windows.h>
14 #endif
15
16 #if !defined(_WIN32_WCE)
17 #include <sys/types.h>
18 #include <stdint.h>
19 #endif
20
21 #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
22 # define EGLAPI __attribute__((visibility("default")))
23 # define EGLAPIENTRY
24 #endif
25
26 /* Macros used in EGL function prototype declarations.
27 *
28 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
29 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
30 *
31 * On Windows, EGLAPIENTRY can be defined like APIENTRY.
32 * On most other platforms, it should be empty.
33 */
34
35 #ifndef EGLAPIENTRY
36 #define EGLAPIENTRY
37 #endif
38 #ifndef EGLAPIENTRYP
39 #define EGLAPIENTRYP EGLAPIENTRY *
40 #endif
41
42 /* The types NativeDisplayType, NativeWindowType, and NativePixmapType
43 * are aliases of window-system-dependent types, such as X Display * or
44 * Windows Device Context. They must be defined in platform-specific
45 * code below. The EGL-prefixed versions of Native*Type are the same
46 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
47 */
48
49 /* Unix (tentative)
50 #include <X headers>
51 typedef Display *NativeDisplayType;
52 - or maybe, if encoding "hostname:display.head"
53 typedef const char *NativeWindowType;
54 etc.
55 */
56
57
58 #if (defined(WIN32) || defined(_WIN32_WCE))
59
60 /** BEGIN Added for Windows **/
61 #ifndef EGLAPI
62 #define EGLAPI __declspec(dllexport)
63 #endif
64
65 typedef long int32_t;
66 typedef unsigned long uint32_t;
67 typedef unsigned char uint8_t;
68 #define snprintf _snprintf
69 #define strcasecmp _stricmp
70 #define vsnprintf _vsnprintf
71
72 typedef HDC NativeDisplayType;
73 typedef HWND NativeWindowType;
74 typedef HBITMAP NativePixmapType;
75 /** END Added for Windows **/
76
77 #elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__APPLE__)
78
79
80 /** BEGIN Added for X (Mesa) **/
81 #ifndef EGLAPI
82 #define EGLAPI extern
83 #endif
84
85 #include <X11/Xlib.h>
86 typedef Display *NativeDisplayType;
87 typedef Window NativeWindowType;
88 typedef Pixmap NativePixmapType;
89 /** END Added for X (Mesa) **/
90
91 #endif
92
93 /* EGL 1.2 types, renamed for consistency in EGL 1.3 */
94 typedef NativeDisplayType EGLNativeDisplayType;
95 typedef NativePixmapType EGLNativePixmapType;
96 typedef NativeWindowType EGLNativeWindowType;
97
98 #endif /* __eglplatform_h */