simpledynamic.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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)
  13. # include <dlfcn.h>
  14. # define SD_INIT NULL
  15. # define SD_SHLIB (RTLD_GLOBAL|RTLD_LAZY)
  16. # define SD_MODULE (RTLD_LOCAL|RTLD_NOW)
  17. typedef void *SD;
  18. typedef void *SD_SYM;
  19. # elif defined(DSO_WIN32)
  20. # include <windows.h>
  21. # define SD_INIT 0
  22. # define SD_SHLIB 0
  23. # define SD_MODULE 0
  24. typedef HINSTANCE SD;
  25. typedef void *SD_SYM;
  26. # endif
  27. # if defined(DSO_DLFCN) || defined(DSO_WIN32)
  28. int sd_load(const char *filename, SD *sd, int type);
  29. int sd_sym(SD sd, const char *symname, SD_SYM *sym);
  30. int sd_close(SD lib);
  31. const char *sd_error(void);
  32. # endif
  33. #endif