TEST: Modify simpledynamic.[ch] to allow use on VMS as well
authorRichard Levitte <levitte@openssl.org>
Wed, 23 Jun 2021 06:21:04 +0000 (08:21 +0200)
committerPauli <pauli@openssl.org>
Thu, 24 Jun 2021 05:55:14 +0000 (15:55 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15872)

test/simpledynamic.c
test/simpledynamic.h

index bbeeae02a497c4f78f61fbbbc83301331fea3c70..390836891fcee158b4def430edda95b45bf37caf 100644 (file)
@@ -12,7 +12,7 @@
 #include <openssl/e_os2.h>
 #include "simpledynamic.h"
 
-#if defined(DSO_DLFCN)
+#if defined(DSO_DLFCN) || defined(DSO_VMS)
 
 int sd_load(const char *filename, SD *lib, int type)
 {
index bf5b21552fb54096ff3a6f5291cb88e2d24ccc37..d6e1dcbfd1eb578876e0cb163f0d67768cc64541 100644 (file)
 
 # include "crypto/dso_conf.h"
 
-# if defined(DSO_DLFCN)
+# if defined(DSO_DLFCN) || defined(DSO_VMS)
 
 #  include <dlfcn.h>
 
 #  define SD_INIT       NULL
-#  define SD_SHLIB      (RTLD_GLOBAL|RTLD_LAZY)
-#  define SD_MODULE     (RTLD_LOCAL|RTLD_NOW)
+#  ifdef DSO_VMS
+#   define SD_SHLIB     0
+#   define SD_MODULE    0
+#  else
+#   define SD_SHLIB     (RTLD_GLOBAL|RTLD_LAZY)
+#   define SD_MODULE    (RTLD_LOCAL|RTLD_NOW)
+#  endif
 
 typedef void *SD;
 typedef void *SD_SYM;
@@ -36,7 +41,7 @@ typedef void *SD_SYM;
 
 # endif
 
-# if defined(DSO_DLFCN) || defined(DSO_WIN32)
+# if defined(DSO_DLFCN) || defined(DSO_WIN32) || defined(DSO_VMS)
 int sd_load(const char *filename, SD *sd, int type);
 int sd_sym(SD sd, const char *symname, SD_SYM *sym);
 int sd_close(SD lib);