From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/include/dlfcn_compat.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/include/dlfcn_compat.h (limited to 'src/include/dlfcn_compat.h') diff --git a/src/include/dlfcn_compat.h b/src/include/dlfcn_compat.h new file mode 100644 index 000000000..95fd64e51 --- /dev/null +++ b/src/include/dlfcn_compat.h @@ -0,0 +1,48 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2020 SUSE LINUX GmbH + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#ifndef DLFCN_COMPAT_H +#define DLFCN_COMPAT_H + +#include "acconfig.h" + +#define SHARED_LIB_SUFFIX CMAKE_SHARED_LIBRARY_SUFFIX + +#ifdef _WIN32 + #include + + using dl_errmsg_t = std::string; + + // The load mode flags will be ignored on Windows. We keep the same + // values for debugging purposes though. + #define RTLD_LAZY 0x00001 + #define RTLD_NOW 0x00002 + #define RTLD_BINDING_MASK 0x3 + #define RTLD_NOLOAD 0x00004 + #define RTLD_DEEPBIND 0x00008 + #define RTLD_GLOBAL 0x00100 + #define RTLD_LOCAL 0 + #define RTLD_NODELETE 0x01000 + + void* dlopen(const char *filename, int flags); + int dlclose(void* handle); + dl_errmsg_t dlerror(); + void* dlsym(void* handle, const char* symbol); +#else + #include + + using dl_errmsg_t = char*; +#endif /* _WIN32 */ + +#endif /* DLFCN_H */ -- cgit v1.2.3