2
0

simpledynamic.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2016-2021 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. #ifndef OSSL_TEST_SIMPLEDYNAMIC_H
  10. # define OSSL_TEST_SIMPLEDYNAMIC_H
  11. # include "crypto/dso_conf.h"
  12. # if defined(DSO_DLFCN) || defined(DSO_VMS)
  13. # include <dlfcn.h>
  14. # define SD_INIT NULL
  15. # ifdef DSO_VMS
  16. # define SD_SHLIB 0
  17. # define SD_MODULE 0
  18. # else
  19. # define SD_SHLIB (RTLD_GLOBAL|RTLD_LAZY)
  20. # define SD_MODULE (RTLD_LOCAL|RTLD_NOW)
  21. # endif
  22. typedef void *SD;
  23. typedef void *SD_SYM;
  24. # elif defined(DSO_WIN32)
  25. # include <windows.h>
  26. # define SD_INIT 0
  27. # define SD_SHLIB 0
  28. # define SD_MODULE 0
  29. typedef HINSTANCE SD;
  30. typedef void *SD_SYM;
  31. # endif
  32. # if defined(DSO_DLFCN) || defined(DSO_WIN32) || defined(DSO_VMS)
  33. int sd_load(const char *filename, SD *sd, int type);
  34. int sd_sym(SD sd, const char *symname, SD_SYM *sym);
  35. int sd_close(SD lib);
  36. const char *sd_error(void);
  37. # endif
  38. #endif