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