247b49f7fe8f95adad5920e7d340ac3d8e673916
[openssl.git] / test / simpledynamic.h
1 /*
2  * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License 2.0 (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #ifndef OSSL_TEST_SIMPLEDYNAMIC_H
11 # define OSSL_TEST_SIMPLEDYNAMIC_H
12
13 # include "crypto/dso_conf.h"
14
15 # if defined(DSO_DLFCN)
16
17 #  include <dlfcn.h>
18
19 #  define SD_INIT       NULL
20 #  define SD_SHLIB      (RTLD_GLOBAL|RTLD_LAZY)
21 #  define SD_MODULE     (RTLD_LOCAL|RTLD_NOW)
22
23 typedef void *SD;
24 typedef void *SD_SYM;
25
26 # elif defined(DSO_WIN32)
27
28 #  include <windows.h>
29
30 #  define SD_INIT       0
31 #  define SD_SHLIB      0
32 #  define SD_MODULE     0
33
34 typedef HINSTANCE SD;
35 typedef void *SD_SYM;
36
37 # endif
38
39 # if defined(DSO_DLFCN) || defined(DSO_WIN32)
40 int sd_load(const char *filename, SD *sd, int type);
41 int sd_sym(SD sd, const char *symname, SD_SYM *sym);
42 int sd_close(SD lib);
43 const char *sd_error(void);
44 # endif
45
46 #endif