gallium/util: Move u_dl and u_pointer to src/util

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17327>
This commit is contained in:
Jesse Natalie 2022-06-30 19:25:19 -07:00 committed by Marge Bot
parent 1141ed5859
commit a0c2b34248
5 changed files with 18 additions and 19 deletions

View File

@ -238,8 +238,6 @@ files_libgallium = files(
'util/u_debug_image.h', 'util/u_debug_image.h',
'util/u_dirty_flags.h', 'util/u_dirty_flags.h',
'util/u_dirty_surfaces.h', 'util/u_dirty_surfaces.h',
'util/u_dl.c',
'util/u_dl.h',
'util/u_draw.c', 'util/u_draw.c',
'util/u_draw.h', 'util/u_draw.h',
'util/u_draw_quad.c', 'util/u_draw_quad.c',
@ -270,7 +268,6 @@ files_libgallium = files(
'util/u_network.c', 'util/u_network.c',
'util/u_network.h', 'util/u_network.h',
'util/u_pack_color.h', 'util/u_pack_color.h',
'util/u_pointer.h',
'util/u_prim.h', 'util/u_prim.h',
'util/u_prim.c', 'util/u_prim.c',
'util/u_prim_restart.c', 'util/u_prim_restart.c',

View File

@ -122,11 +122,14 @@ files_mesa_util = files(
'u_debug_describe.h', 'u_debug_describe.h',
'u_debug_refcnt.c', 'u_debug_refcnt.c',
'u_debug_refcnt.h', 'u_debug_refcnt.h',
'u_dl.c',
'u_dl.h',
'u_dynarray.h', 'u_dynarray.h',
'u_endian.h', 'u_endian.h',
'u_fifo.h', 'u_fifo.h',
'u_hash_table.c', 'u_hash_table.c',
'u_hash_table.h', 'u_hash_table.h',
'u_pointer.h',
'u_queue.c', 'u_queue.c',
'u_queue.h', 'u_queue.h',
'u_string.h', 'u_string.h',

View File

@ -27,13 +27,12 @@
**************************************************************************/ **************************************************************************/
#include "pipe/p_config.h" #include "detect_os.h"
#include "pipe/p_compiler.h"
#if defined(PIPE_OS_UNIX) #if DETECT_OS_UNIX
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#if defined(PIPE_OS_WINDOWS) #if DETECT_OS_WINDOWS
#include <windows.h> #include <windows.h>
#endif #endif
@ -44,9 +43,9 @@
struct util_dl_library * struct util_dl_library *
util_dl_open(const char *filename) util_dl_open(const char *filename)
{ {
#if defined(PIPE_OS_UNIX) #if DETECT_OS_UNIX
return (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_LOCAL); return (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
#elif defined(PIPE_OS_WINDOWS) #elif DETECT_OS_WINDOWS
return (struct util_dl_library *)LoadLibraryA(filename); return (struct util_dl_library *)LoadLibraryA(filename);
#else #else
return NULL; return NULL;
@ -58,9 +57,9 @@ util_dl_proc
util_dl_get_proc_address(struct util_dl_library *library, util_dl_get_proc_address(struct util_dl_library *library,
const char *procname) const char *procname)
{ {
#if defined(PIPE_OS_UNIX) #if DETECT_OS_UNIX
return (util_dl_proc) pointer_to_func(dlsym((void *)library, procname)); return (util_dl_proc) pointer_to_func(dlsym((void *)library, procname));
#elif defined(PIPE_OS_WINDOWS) #elif DETECT_OS_WINDOWS
return (util_dl_proc)GetProcAddress((HMODULE)library, procname); return (util_dl_proc)GetProcAddress((HMODULE)library, procname);
#else #else
return (util_dl_proc)NULL; return (util_dl_proc)NULL;
@ -71,9 +70,9 @@ util_dl_get_proc_address(struct util_dl_library *library,
void void
util_dl_close(struct util_dl_library *library) util_dl_close(struct util_dl_library *library)
{ {
#if defined(PIPE_OS_UNIX) #if DETECT_OS_UNIX
dlclose((void *)library); dlclose((void *)library);
#elif defined(PIPE_OS_WINDOWS) #elif DETECT_OS_WINDOWS
FreeLibrary((HMODULE)library); FreeLibrary((HMODULE)library);
#else #else
(void)library; (void)library;
@ -84,9 +83,9 @@ util_dl_close(struct util_dl_library *library)
const char * const char *
util_dl_error(void) util_dl_error(void)
{ {
#if defined(PIPE_OS_UNIX) #if DETECT_OS_UNIX
return dlerror(); return dlerror();
#elif defined(PIPE_OS_WINDOWS) #elif DETECT_OS_WINDOWS
return "unknown error"; return "unknown error";
#else #else
return "unknown error"; return "unknown error";

View File

@ -30,16 +30,16 @@
#define U_DL_H_ #define U_DL_H_
#include "pipe/p_config.h" #include "detect_os.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if defined(PIPE_OS_WINDOWS) #if DETECT_OS_WINDOWS
# define UTIL_DL_EXT ".dll" # define UTIL_DL_EXT ".dll"
# define UTIL_DL_PREFIX "" # define UTIL_DL_PREFIX ""
#elif defined(PIPE_OS_APPLE) #elif DETECT_OS_APPLE
# define UTIL_DL_EXT ".dylib" # define UTIL_DL_EXT ".dylib"
# define UTIL_DL_PREFIX "lib" # define UTIL_DL_PREFIX "lib"
#else #else

View File

@ -28,7 +28,7 @@
#ifndef U_POINTER_H #ifndef U_POINTER_H
#define U_POINTER_H #define U_POINTER_H
#include "pipe/p_compiler.h" #include <stdint.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {