VMS: mitigate for the C++ compiler that doesn't understand certain pragmas
authorRichard Levitte <levitte@openssl.org>
Mon, 24 Feb 2020 13:56:26 +0000 (14:56 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 27 Feb 2020 00:29:15 +0000 (01:29 +0100)
This only affects __DECC_INCLUDE_EPILOGUE.H and __DECC_INCLUDE_PROLOGUE.H,
which are used automatically by HP and VSI C/C++ compilers.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/11159)

(cherry picked from commit 605a0c709f4d50497a1c49ee117a0ec4bb956d58)

CHANGES.md
include/openssl/__DECC_INCLUDE_EPILOGUE.H
include/openssl/__DECC_INCLUDE_PROLOGUE.H

index c6d93ef3ed6d00375ce0351209493d5d48eca3c1..84867ff29c7e8f7f6a9821d0d25a06d70f089a9d 100644 (file)
@@ -935,6 +935,19 @@ OpenSSL 1.1.1
 
 ### Changes between 1.1.1d and 1.1.1e [xx XXX xxxx] ###
 
+ * *[VMS only]* The header files that the VMS compilers include automatically,
+   `__DECC_INCLUDE_PROLOGUE.H` and `__DECC_INCLUDE_EPILOGUE.H`, use pragmas
+   that the C++ compiler doesn't understand.  This is a shortcoming in the
+   compiler, but can be worked around with `__cplusplus` guards.
+
+   C++ applications that use OpenSSL libraries must be compiled using the
+   qualifier `/NAMES=(AS_IS,SHORTENED)` to be able to use all the OpenSSL
+   functions.  Otherwise, only functions with symbols of less than 31
+   characters can be used, as the linker will not be able to successfully
+   resolve symbols with longer names.
+
+   *Richard Levitte*
+
  * Added a new method to gather entropy on VMS, based on SYS$GET_ENTROPY.
    The presence of this system service is determined at run-time.
 
index e57c0eab3e3afa3026813c60e1e82798ad38af2c..b051919ebc2bdd88f392afee3d805916e03e1bca 100644 (file)
@@ -8,9 +8,15 @@
  */
 
 /*
- * This file is only used by HP C on VMS, and is included automatically
+ * This file is only used by HP C/C++ on VMS, and is included automatically
  * after each header file from this directory
  */
 
+/*
+ * The C++ compiler doesn't understand these pragmas, even though it
+ * understands the corresponding command line qualifier.
+ */
+#ifndef __cplusplus
 /* restore state.  Must correspond to the save in __decc_include_prologue.h */
-#pragma names restore
+# pragma names restore
+#endif
index a013957557138537a24ffc7469e810efe4c1f452..d8f6dc4b851baf697607523e25ca5aab11b702e0 100644 (file)
@@ -8,13 +8,19 @@
  */
 
 /*
- * This file is only used by HP C on VMS, and is included automatically
+ * This file is only used by HP C/C++ on VMS, and is included automatically
  * after each header file from this directory
  */
 
+/*
+ * The C++ compiler doesn't understand these pragmas, even though it
+ * understands the corresponding command line qualifier.
+ */
+#ifndef __cplusplus
 /* save state */
-#pragma names save
+# pragma names save
 /* have the compiler shorten symbols larger than 31 chars to 23 chars
  * followed by a 8 hex char CRC
  */
-#pragma names as_is,shortened
+# pragma names as_is,shortened
+#endif