egl: s/_EGL_PLATFORM/_EGL_OS/ and s/POSIX/UNIX/.
A platform means a native window system in EGL. Use OS that follows Gallium instead.
This commit is contained in:
parent
8f3e48ee2c
commit
6f690caddc
|
@ -49,7 +49,7 @@ OBJECTS = $(SOURCES:.c=.o)
|
||||||
|
|
||||||
|
|
||||||
# use dl*() to load drivers
|
# use dl*() to load drivers
|
||||||
LOCAL_CFLAGS = -D_EGL_PLATFORM_POSIX=1
|
LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
|
||||||
|
|
||||||
EGL_DEFAULT_DISPLAY = $(word 1, $(EGL_DISPLAYS))
|
EGL_DEFAULT_DISPLAY = $(word 1, $(EGL_DISPLAYS))
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ if env['platform'] != 'winddk':
|
||||||
env.Append(CPPDEFINES = [
|
env.Append(CPPDEFINES = [
|
||||||
'_EGL_DEFAULT_DISPLAY=\\"gdi\\"',
|
'_EGL_DEFAULT_DISPLAY=\\"gdi\\"',
|
||||||
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
|
'_EGL_DRIVER_SEARCH_DIR=\\"\\"',
|
||||||
'_EGL_PLATFORM_WINDOWS',
|
'_EGL_OS_WINDOWS',
|
||||||
'KHRONOS_DLL_EXPORTS',
|
'KHRONOS_DLL_EXPORTS',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "eglsurface.h"
|
#include "eglsurface.h"
|
||||||
#include "eglimage.h"
|
#include "eglimage.h"
|
||||||
|
|
||||||
#if defined(_EGL_PLATFORM_POSIX)
|
#if defined(_EGL_OS_UNIX)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
/**
|
/**
|
||||||
* Wrappers for dlopen/dlclose()
|
* Wrappers for dlopen/dlclose()
|
||||||
*/
|
*/
|
||||||
#if defined(_EGL_PLATFORM_WINDOWS)
|
#if defined(_EGL_OS_WINDOWS)
|
||||||
|
|
||||||
|
|
||||||
/* XXX Need to decide how to do dynamic name lookup on Windows */
|
/* XXX Need to decide how to do dynamic name lookup on Windows */
|
||||||
|
@ -64,7 +64,7 @@ library_suffix(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#elif defined(_EGL_PLATFORM_POSIX)
|
#elif defined(_EGL_OS_UNIX)
|
||||||
|
|
||||||
|
|
||||||
static const char *DefaultDriverNames[] = {
|
static const char *DefaultDriverNames[] = {
|
||||||
|
@ -119,11 +119,11 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
|
||||||
_eglLog(_EGL_DEBUG, "dlopen(%s)", driverPath);
|
_eglLog(_EGL_DEBUG, "dlopen(%s)", driverPath);
|
||||||
lib = open_library(driverPath);
|
lib = open_library(driverPath);
|
||||||
|
|
||||||
#if defined(_EGL_PLATFORM_WINDOWS)
|
#if defined(_EGL_OS_WINDOWS)
|
||||||
/* XXX untested */
|
/* XXX untested */
|
||||||
if (lib)
|
if (lib)
|
||||||
mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain");
|
mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain");
|
||||||
#elif defined(_EGL_PLATFORM_POSIX)
|
#elif defined(_EGL_OS_UNIX)
|
||||||
if (lib) {
|
if (lib) {
|
||||||
union {
|
union {
|
||||||
_EGLMain_t func;
|
_EGLMain_t func;
|
||||||
|
@ -301,7 +301,7 @@ _eglLoaderFile(const char *dir, size_t len, void *loader_data)
|
||||||
static EGLBoolean
|
static EGLBoolean
|
||||||
_eglLoaderPattern(const char *dir, size_t len, void *loader_data)
|
_eglLoaderPattern(const char *dir, size_t len, void *loader_data)
|
||||||
{
|
{
|
||||||
#if defined(_EGL_PLATFORM_POSIX)
|
#if defined(_EGL_OS_UNIX)
|
||||||
const char *prefix, *suffix;
|
const char *prefix, *suffix;
|
||||||
size_t prefix_len, suffix_len;
|
size_t prefix_len, suffix_len;
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
|
@ -352,7 +352,7 @@ _eglLoaderPattern(const char *dir, size_t len, void *loader_data)
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
|
|
||||||
return EGL_TRUE;
|
return EGL_TRUE;
|
||||||
#else /* _EGL_PLATFORM_POSIX */
|
#else /* _EGL_OS_UNIX */
|
||||||
/* stop immediately */
|
/* stop immediately */
|
||||||
return EGL_FALSE;
|
return EGL_FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
@ -397,20 +397,20 @@ _eglGetSearchPath(void)
|
||||||
{
|
{
|
||||||
static const char *search_path;
|
static const char *search_path;
|
||||||
|
|
||||||
#if defined(_EGL_PLATFORM_POSIX) || defined(_EGL_PLATFORM_WINDOWS)
|
#if defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS)
|
||||||
if (!search_path) {
|
if (!search_path) {
|
||||||
static char buffer[1024];
|
static char buffer[1024];
|
||||||
const char *p;
|
const char *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
p = getenv("EGL_DRIVERS_PATH");
|
p = getenv("EGL_DRIVERS_PATH");
|
||||||
#if defined(_EGL_PLATFORM_POSIX)
|
#if defined(_EGL_OS_UNIX)
|
||||||
if (p && (geteuid() != getuid() || getegid() != getgid())) {
|
if (p && (geteuid() != getuid() || getegid() != getgid())) {
|
||||||
_eglLog(_EGL_DEBUG,
|
_eglLog(_EGL_DEBUG,
|
||||||
"ignore EGL_DRIVERS_PATH for setuid/setgid binaries");
|
"ignore EGL_DRIVERS_PATH for setuid/setgid binaries");
|
||||||
p = NULL;
|
p = NULL;
|
||||||
}
|
}
|
||||||
#endif /* _EGL_PLATFORM_POSIX */
|
#endif /* _EGL_OS_UNIX */
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
ret = _eglsnprintf(buffer, sizeof(buffer),
|
ret = _eglsnprintf(buffer, sizeof(buffer),
|
||||||
|
@ -441,7 +441,7 @@ _eglPreloadUserDriver(void)
|
||||||
char *env;
|
char *env;
|
||||||
|
|
||||||
env = getenv("EGL_DRIVER");
|
env = getenv("EGL_DRIVER");
|
||||||
#if defined(_EGL_PLATFORM_POSIX)
|
#if defined(_EGL_OS_UNIX)
|
||||||
if (env && strchr(env, '/')) {
|
if (env && strchr(env, '/')) {
|
||||||
search_path = "";
|
search_path = "";
|
||||||
if ((geteuid() != getuid() || getegid() != getgid())) {
|
if ((geteuid() != getuid() || getegid() != getgid())) {
|
||||||
|
@ -450,7 +450,7 @@ _eglPreloadUserDriver(void)
|
||||||
env = NULL;
|
env = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* _EGL_PLATFORM_POSIX */
|
#endif /* _EGL_OS_UNIX */
|
||||||
if (!env)
|
if (!env)
|
||||||
return EGL_FALSE;
|
return EGL_FALSE;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef _EGL_PLATFORM_WINDOWS
|
#ifdef _EGL_OS_WINDOWS
|
||||||
#define _eglstrcasecmp _stricmp
|
#define _eglstrcasecmp _stricmp
|
||||||
#define _eglsnprintf _snprintf
|
#define _eglsnprintf _snprintf
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue