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:
parent
1141ed5859
commit
a0c2b34248
|
@ -238,8 +238,6 @@ files_libgallium = files(
|
|||
'util/u_debug_image.h',
|
||||
'util/u_dirty_flags.h',
|
||||
'util/u_dirty_surfaces.h',
|
||||
'util/u_dl.c',
|
||||
'util/u_dl.h',
|
||||
'util/u_draw.c',
|
||||
'util/u_draw.h',
|
||||
'util/u_draw_quad.c',
|
||||
|
@ -270,7 +268,6 @@ files_libgallium = files(
|
|||
'util/u_network.c',
|
||||
'util/u_network.h',
|
||||
'util/u_pack_color.h',
|
||||
'util/u_pointer.h',
|
||||
'util/u_prim.h',
|
||||
'util/u_prim.c',
|
||||
'util/u_prim_restart.c',
|
||||
|
|
|
@ -122,11 +122,14 @@ files_mesa_util = files(
|
|||
'u_debug_describe.h',
|
||||
'u_debug_refcnt.c',
|
||||
'u_debug_refcnt.h',
|
||||
'u_dl.c',
|
||||
'u_dl.h',
|
||||
'u_dynarray.h',
|
||||
'u_endian.h',
|
||||
'u_fifo.h',
|
||||
'u_hash_table.c',
|
||||
'u_hash_table.h',
|
||||
'u_pointer.h',
|
||||
'u_queue.c',
|
||||
'u_queue.h',
|
||||
'u_string.h',
|
||||
|
|
|
@ -27,13 +27,12 @@
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
#include "pipe/p_config.h"
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "detect_os.h"
|
||||
|
||||
#if defined(PIPE_OS_UNIX)
|
||||
#if DETECT_OS_UNIX
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#if defined(PIPE_OS_WINDOWS)
|
||||
#if DETECT_OS_WINDOWS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -44,9 +43,9 @@
|
|||
struct util_dl_library *
|
||||
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);
|
||||
#elif defined(PIPE_OS_WINDOWS)
|
||||
#elif DETECT_OS_WINDOWS
|
||||
return (struct util_dl_library *)LoadLibraryA(filename);
|
||||
#else
|
||||
return NULL;
|
||||
|
@ -58,9 +57,9 @@ util_dl_proc
|
|||
util_dl_get_proc_address(struct util_dl_library *library,
|
||||
const char *procname)
|
||||
{
|
||||
#if defined(PIPE_OS_UNIX)
|
||||
#if DETECT_OS_UNIX
|
||||
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);
|
||||
#else
|
||||
return (util_dl_proc)NULL;
|
||||
|
@ -71,9 +70,9 @@ util_dl_get_proc_address(struct util_dl_library *library,
|
|||
void
|
||||
util_dl_close(struct util_dl_library *library)
|
||||
{
|
||||
#if defined(PIPE_OS_UNIX)
|
||||
#if DETECT_OS_UNIX
|
||||
dlclose((void *)library);
|
||||
#elif defined(PIPE_OS_WINDOWS)
|
||||
#elif DETECT_OS_WINDOWS
|
||||
FreeLibrary((HMODULE)library);
|
||||
#else
|
||||
(void)library;
|
||||
|
@ -84,9 +83,9 @@ util_dl_close(struct util_dl_library *library)
|
|||
const char *
|
||||
util_dl_error(void)
|
||||
{
|
||||
#if defined(PIPE_OS_UNIX)
|
||||
#if DETECT_OS_UNIX
|
||||
return dlerror();
|
||||
#elif defined(PIPE_OS_WINDOWS)
|
||||
#elif DETECT_OS_WINDOWS
|
||||
return "unknown error";
|
||||
#else
|
||||
return "unknown error";
|
|
@ -30,16 +30,16 @@
|
|||
#define U_DL_H_
|
||||
|
||||
|
||||
#include "pipe/p_config.h"
|
||||
#include "detect_os.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(PIPE_OS_WINDOWS)
|
||||
#if DETECT_OS_WINDOWS
|
||||
# define UTIL_DL_EXT ".dll"
|
||||
# define UTIL_DL_PREFIX ""
|
||||
#elif defined(PIPE_OS_APPLE)
|
||||
#elif DETECT_OS_APPLE
|
||||
# define UTIL_DL_EXT ".dylib"
|
||||
# define UTIL_DL_PREFIX "lib"
|
||||
#else
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef U_POINTER_H
|
||||
#define U_POINTER_H
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
Loading…
Reference in New Issue