#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "c99_compat.h"
#include "eglglobals.h"
#include "eglcontext.h"
_EGL_CHECK_OBJECT(disp, Sync, s, ret, drv)
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckDisplay(_EGLDisplay *disp, const char *msg)
{
if (!disp) {
}
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckSurface(_EGLDisplay *disp, _EGLSurface *surf, const char *msg)
{
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
}
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckContext(_EGLDisplay *disp, _EGLContext *context, const char *msg)
{
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
}
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckConfig(_EGLDisplay *disp, _EGLConfig *conf, const char *msg)
{
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
}
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckSync(_EGLDisplay *disp, _EGLSync *s, const char *msg)
{
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
#ifdef EGL_MESA_screen_surface
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckScreen(_EGLDisplay *disp, _EGLScreen *scrn, const char *msg)
{
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
}
-static INLINE _EGLDriver *
+static inline _EGLDriver *
_eglCheckMode(_EGLDisplay *disp, _EGLMode *m, const char *msg)
{
_EGLDriver *drv = _eglCheckDisplay(disp, msg);
/**
* Lookup and lock a display.
*/
-static INLINE _EGLDisplay *
+static inline _EGLDisplay *
_eglLockDisplay(EGLDisplay display)
{
_EGLDisplay *dpy = _eglLookupDisplay(display);
/**
* Unlock a display.
*/
-static INLINE void
+static inline void
_eglUnlockDisplay(_EGLDisplay *dpy)
{
_eglUnlockMutex(&dpy->Mutex);
#ifndef EGLARRAY_INCLUDED
#define EGLARRAY_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
_EGLArrayForEach flatten);
-static INLINE EGLint
+static inline EGLint
_eglGetArraySize(_EGLArray *array)
{
return (array) ? array->Size : 0;
#define EGLCOMPILER_INCLUDED
-#include "c99_compat.h" /* inline, __func__, etc. */
+#include "c99_compat.h" /* __func__, etc. */
/**
#endif
-/* XXX: Use standard `inline` keyword instead */
-#ifndef INLINE
-# define INLINE inline
-#endif
-
-
/**
* Function visibility
*/
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include "c99_compat.h"
+
#include "eglconfig.h"
#include "egldisplay.h"
#include "eglcurrent.h"
return matched;
}
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
{
if (_eglOffsetOfConfig(attr) < 0)
}
-static INLINE
+static inline
void _eglSwapConfigs(const _EGLConfig **conf1, const _EGLConfig **conf2)
{
const _EGLConfig *tmp = *conf1;
#include <assert.h>
#include <stddef.h>
+#include "c99_compat.h"
+
#include "egltypedefs.h"
/**
* Map an EGL attribute enum to the offset of the member in _EGLConfig.
*/
-static INLINE EGLint
+static inline EGLint
_eglOffsetOfConfig(EGLint attr)
{
switch (attr) {
* in the attribute enums. The separation is to catch application errors.
* Drivers should never set a key that is an invalid attribute.
*/
-static INLINE void
+static inline void
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
{
EGLint offset = _eglOffsetOfConfig(key);
/**
* Return the value for a given key.
*/
-static INLINE EGLint
+static inline EGLint
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
{
EGLint offset = _eglOffsetOfConfig(key);
/**
* Return the handle of a linked config.
*/
-static INLINE EGLConfig
+static inline EGLConfig
_eglGetConfigHandle(_EGLConfig *conf)
{
return (EGLConfig) conf;
#ifndef EGLCONTEXT_INCLUDED
#define EGLCONTEXT_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
#include "egldisplay.h"
/**
* Increment reference count for the context.
*/
-static INLINE _EGLContext *
+static inline _EGLContext *
_eglGetContext(_EGLContext *ctx)
{
if (ctx)
/**
* Decrement reference count for the context.
*/
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglPutContext(_EGLContext *ctx)
{
return (ctx) ? _eglPutResource(&ctx->Resource) : EGL_FALSE;
* Link a context to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
-static INLINE EGLContext
+static inline EGLContext
_eglLinkContext(_EGLContext *ctx)
{
_eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
* Unlink a linked context from its display.
* Accessing an unlinked context should generate EGL_BAD_CONTEXT error.
*/
-static INLINE void
+static inline void
_eglUnlinkContext(_EGLContext *ctx)
{
_eglUnlinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
* Lookup a handle to find the linked context.
* Return NULL if the handle has no corresponding linked context.
*/
-static INLINE _EGLContext *
+static inline _EGLContext *
_eglLookupContext(EGLContext context, _EGLDisplay *dpy)
{
_EGLContext *ctx = (_EGLContext *) context;
/**
* Return the handle of a linked context, or EGL_NO_CONTEXT.
*/
-static INLINE EGLContext
+static inline EGLContext
_eglGetContextHandle(_EGLContext *ctx)
{
_EGLResource *res = (_EGLResource *) ctx;
#include <stdlib.h>
#include <string.h>
+#include "c99_compat.h"
+
#include "egllog.h"
#include "eglmutex.h"
#include "eglcurrent.h"
__attribute__ ((tls_model("initial-exec")));
#endif
-static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
+static inline void _eglSetTSD(const _EGLThreadInfo *t)
{
pthread_setspecific(_egl_TSD, (const void *) t);
#ifdef GLX_USE_TLS
#endif
}
-static INLINE _EGLThreadInfo *_eglGetTSD(void)
+static inline _EGLThreadInfo *_eglGetTSD(void)
{
#ifdef GLX_USE_TLS
return (_EGLThreadInfo *) _egl_TLS;
#endif
}
-static INLINE void _eglFiniTSD(void)
+static inline void _eglFiniTSD(void)
{
_eglLockMutex(&_egl_TSDMutex);
if (_egl_TSDInitialized) {
_eglUnlockMutex(&_egl_TSDMutex);
}
-static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
+static inline EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
{
if (!_egl_TSDInitialized) {
_eglLockMutex(&_egl_TSDMutex);
static const _EGLThreadInfo *_egl_TSD;
static void (*_egl_FreeTSD)(_EGLThreadInfo *);
-static INLINE void _eglSetTSD(const _EGLThreadInfo *t)
+static inline void _eglSetTSD(const _EGLThreadInfo *t)
{
_egl_TSD = t;
}
-static INLINE _EGLThreadInfo *_eglGetTSD(void)
+static inline _EGLThreadInfo *_eglGetTSD(void)
{
return (_EGLThreadInfo *) _egl_TSD;
}
-static INLINE void _eglFiniTSD(void)
+static inline void _eglFiniTSD(void)
{
if (_egl_FreeTSD && _egl_TSD)
_egl_FreeTSD((_EGLThreadInfo *) _egl_TSD);
}
-static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
+static inline EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
{
if (!_egl_FreeTSD && dtor) {
_egl_FreeTSD = dtor;
/**
* Make sure TSD is initialized and return current value.
*/
-static INLINE _EGLThreadInfo *
+static inline _EGLThreadInfo *
_eglCheckedGetTSD(void)
{
if (_eglInitTSD(&_eglDestroyThreadInfo) != EGL_TRUE) {
#ifndef EGLCURRENT_INCLUDED
#define EGLCURRENT_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
/**
* Return true if a client API enum is recognized.
*/
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglIsApiValid(EGLenum api)
{
return (api >= _EGL_API_FIRST_API && api <= _EGL_API_LAST_API);
* Convert a client API enum to an index, for use by thread info.
* The client API enum is assumed to be valid.
*/
-static INLINE EGLint
+static inline EGLint
_eglConvertApiToIndex(EGLenum api)
{
return api - _EGL_API_FIRST_API;
* Convert an index, used by thread info, to a client API enum.
* The index is assumed to be valid.
*/
-static INLINE EGLenum
+static inline EGLenum
_eglConvertApiFromIndex(EGLint idx)
{
return _EGL_API_FIRST_API + idx;
#ifndef EGLDISPLAY_INCLUDED
#define EGLDISPLAY_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
#include "egldefines.h"
* Lookup a handle to find the linked display.
* Return NULL if the handle has no corresponding linked display.
*/
-static INLINE _EGLDisplay *
+static inline _EGLDisplay *
_eglLookupDisplay(EGLDisplay display)
{
_EGLDisplay *dpy = (_EGLDisplay *) display;
/**
* Return the handle of a linked display, or EGL_NO_DISPLAY.
*/
-static INLINE EGLDisplay
+static inline EGLDisplay
_eglGetDisplayHandle(_EGLDisplay *dpy)
{
return (EGLDisplay) ((dpy) ? dpy : EGL_NO_DISPLAY);
/**
* Return true if the resource is linked.
*/
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglIsResourceLinked(_EGLResource *res)
{
return res->IsLinked;
#define EGLDRIVER_INCLUDED
+#include "c99_compat.h"
+
#include "egltypedefs.h"
#include "eglapi.h"
#include <stddef.h>
* semicolon when used.
*/
#define _EGL_DRIVER_TYPECAST(drvtype, egltype, code) \
- static INLINE struct drvtype *drvtype(const egltype *obj) \
+ static inline struct drvtype *drvtype(const egltype *obj) \
{ return (struct drvtype *) code; }
#ifndef EGLIMAGE_INCLUDED
#define EGLIMAGE_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
#include "egldisplay.h"
/**
* Increment reference count for the image.
*/
-static INLINE _EGLImage *
+static inline _EGLImage *
_eglGetImage(_EGLImage *img)
{
if (img)
/**
* Decrement reference count for the image.
*/
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglPutImage(_EGLImage *img)
{
return (img) ? _eglPutResource(&img->Resource) : EGL_FALSE;
* Link an image to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
-static INLINE EGLImageKHR
+static inline EGLImageKHR
_eglLinkImage(_EGLImage *img)
{
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
* Unlink a linked image from its display.
* Accessing an unlinked image should generate EGL_BAD_PARAMETER error.
*/
-static INLINE void
+static inline void
_eglUnlinkImage(_EGLImage *img)
{
_eglUnlinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
* Lookup a handle to find the linked image.
* Return NULL if the handle has no corresponding linked image.
*/
-static INLINE _EGLImage *
+static inline _EGLImage *
_eglLookupImage(EGLImageKHR image, _EGLDisplay *dpy)
{
_EGLImage *img = (_EGLImage *) image;
/**
* Return the handle of a linked image, or EGL_NO_IMAGE_KHR.
*/
-static INLINE EGLImageKHR
+static inline EGLImageKHR
_eglGetImageHandle(_EGLImage *img)
{
_EGLResource *res = (_EGLResource *) img;
#ifndef EGLMUTEX_INCLUDED
#define EGLMUTEX_INCLUDED
+#include "c99_compat.h"
+
#include "eglcompiler.h"
#include "c11/threads.h"
typedef mtx_t _EGLMutex;
-static INLINE void _eglInitMutex(_EGLMutex *m)
+static inline void _eglInitMutex(_EGLMutex *m)
{
mtx_init(m, mtx_plain);
}
-static INLINE void
+static inline void
_eglDestroyMutex(_EGLMutex *m)
{
mtx_destroy(m);
}
-static INLINE void
+static inline void
_eglLockMutex(_EGLMutex *m)
{
mtx_lock(m);
}
-static INLINE void
+static inline void
_eglUnlockMutex(_EGLMutex *m)
{
mtx_unlock(m);
#ifndef EGLSCREEN_INCLUDED
#define EGLSCREEN_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
/**
* Return the handle of a linked screen.
*/
-static INLINE EGLScreenMESA
+static inline EGLScreenMESA
_eglGetScreenHandle(_EGLScreen *screen)
{
return (screen) ? screen->Handle : (EGLScreenMESA) 0;
#ifndef EGLSURFACE_INCLUDED
#define EGLSURFACE_INCLUDED
+#include "c99_compat.h"
#include "egltypedefs.h"
#include "egldisplay.h"
/**
* Increment reference count for the surface.
*/
-static INLINE _EGLSurface *
+static inline _EGLSurface *
_eglGetSurface(_EGLSurface *surf)
{
if (surf)
/**
* Decrement reference count for the surface.
*/
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglPutSurface(_EGLSurface *surf)
{
return (surf) ? _eglPutResource(&surf->Resource) : EGL_FALSE;
* Link a surface to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
-static INLINE EGLSurface
+static inline EGLSurface
_eglLinkSurface(_EGLSurface *surf)
{
_eglLinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE);
* Unlink a linked surface from its display.
* Accessing an unlinked surface should generate EGL_BAD_SURFACE error.
*/
-static INLINE void
+static inline void
_eglUnlinkSurface(_EGLSurface *surf)
{
_eglUnlinkResource(&surf->Resource, _EGL_RESOURCE_SURFACE);
* Lookup a handle to find the linked surface.
* Return NULL if the handle has no corresponding linked surface.
*/
-static INLINE _EGLSurface *
+static inline _EGLSurface *
_eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy)
{
_EGLSurface *surf = (_EGLSurface *) surface;
/**
* Return the handle of a linked surface, or EGL_NO_SURFACE.
*/
-static INLINE EGLSurface
+static inline EGLSurface
_eglGetSurfaceHandle(_EGLSurface *surf)
{
_EGLResource *res = (_EGLResource *) surf;
#define EGLSYNC_INCLUDED
+#include "c99_compat.h"
+
#include "egltypedefs.h"
#include "egldisplay.h"
/**
* Increment reference count for the sync.
*/
-static INLINE _EGLSync *
+static inline _EGLSync *
_eglGetSync(_EGLSync *sync)
{
if (sync)
/**
* Decrement reference count for the sync.
*/
-static INLINE EGLBoolean
+static inline EGLBoolean
_eglPutSync(_EGLSync *sync)
{
return (sync) ? _eglPutResource(&sync->Resource) : EGL_FALSE;
* Link a sync to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
-static INLINE EGLSyncKHR
+static inline EGLSyncKHR
_eglLinkSync(_EGLSync *sync)
{
_eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
/**
* Unlink a linked sync from its display.
*/
-static INLINE void
+static inline void
_eglUnlinkSync(_EGLSync *sync)
{
_eglUnlinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
* Lookup a handle to find the linked sync.
* Return NULL if the handle has no corresponding linked sync.
*/
-static INLINE _EGLSync *
+static inline _EGLSync *
_eglLookupSync(EGLSyncKHR handle, _EGLDisplay *dpy)
{
_EGLSync *sync = (_EGLSync *) handle;
/**
* Return the handle of a linked sync, or EGL_NO_SYNC_KHR.
*/
-static INLINE EGLSyncKHR
+static inline EGLSyncKHR
_eglGetSyncHandle(_EGLSync *sync)
{
_EGLResource *res = (_EGLResource *) sync;