]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2020 SUSE LINUX GmbH | |
7 | * | |
8 | * This is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU Lesser General Public | |
10 | * License version 2.1, as published by the Free Software | |
11 | * Foundation. See file COPYING. | |
12 | * | |
13 | */ | |
14 | ||
15 | #include <sstream> | |
16 | #include <windows.h> | |
17 | ||
18 | #include "common/errno.h" | |
19 | #include "include/dlfcn_compat.h" | |
20 | ||
21 | ||
22 | void* dlopen(const char *filename, int flags) { | |
23 | return LoadLibrary(filename); | |
24 | } | |
25 | ||
26 | int dlclose(void* handle) { | |
27 | //FreeLibrary returns 0 on error, as opposed to dlclose. | |
28 | return !FreeLibrary(handle); | |
29 | } | |
30 | ||
31 | void* dlsym(void* handle, const char* symbol) { | |
32 | return (void*)GetProcAddress(handle, symbol); | |
33 | } | |
34 | ||
35 | dl_errmsg_t dlerror() { | |
36 | return win32_lasterror_str(); | |
37 | } | |
38 |