Use NON_EMPTY_TRANSLATION_UNIT, consistently.
authorRich Salz <rsalz@akamai.com>
Sun, 31 Jan 2016 18:08:23 +0000 (13:08 -0500)
committerRich Salz <rsalz@openssl.org>
Wed, 10 Feb 2016 01:13:29 +0000 (20:13 -0500)
This also closes RT 4123

Reviewed-by: Richard Levitte <levitte@openssl.org>
31 files changed:
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/ec.c
apps/ecparam.c
apps/engine.c
apps/gendsa.c
apps/genrsa.c
apps/rsa.c
apps/rsautl.c
apps/srp.c
crypto/Makefile.in
crypto/asn1/n_pkey.c
crypto/bn/bn_depr.c
crypto/bn/rsaz_exp.c
crypto/build.info
crypto/crypto-lib.com
crypto/dh/dh_depr.c
crypto/dsa/dsa_depr.c
crypto/ebcdic.c
crypto/ec/ecp_nistp224.c
crypto/ec/ecp_nistp256.c
crypto/ec/ecp_nistp521.c
crypto/ec/ecp_nistputil.c
crypto/evp/e_camellia.c
crypto/evp/e_old.c
crypto/evp/p_open.c
crypto/fips_ers.c
crypto/rand/rand_egd.c
crypto/rsa/rsa_depr.c
include/openssl/opensslconf.h.in

index e794dacd1d6f40ddc5f71eae0a7f7d0f491148dd..f7fd8c0c351970a95edd48f2356b2f6d691b62bb 100644 (file)
  *
  */
 
-#include <openssl/opensslconf.h> /* for OPENSSL_NO_DH */
-#ifndef OPENSSL_NO_DH
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DH
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <stdio.h>
 # include <stdlib.h>
 # include <time.h>
@@ -443,11 +446,4 @@ static int dh_cb(int p, int n, BN_GENCB *cb)
     (void)BIO_flush(BN_GENCB_get_arg(cb));
     return 1;
 }
-
-#else                           /* !OPENSSL_NO_DH */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index ebb5775a8b2f970c9399c2e42aa40c65d1d553f8..5ee97cf66bb692371ca3dc48073da57e4839d2d9 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
-#ifndef OPENSSL_NO_DSA
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <stdio.h>
 # include <stdlib.h>
 # include <string.h>
@@ -299,10 +302,4 @@ int dsa_main(int argc, char **argv)
     OPENSSL_free(passout);
     return (ret);
 }
-#else                           /* !OPENSSL_NO_DSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index c8c383faeb301c9f9fdd0fc78063b447a5aa301f..7b9ca631a79ef980b9a00b7aaebde6b0e2e7d5ca 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-#ifndef OPENSSL_NO_DSA
 # include <stdio.h>
 # include <stdlib.h>
 # include <time.h>
@@ -347,10 +349,4 @@ static int dsa_cb(int p, int n, BN_GENCB *cb)
 # endif
     return 1;
 }
-#else                           /* !OPENSSL_NO_DSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index a3fecd412a17a394c09ff76884f8c2b90ff2d33d..6f811e35c9045a292fd36326ff64e16eef9926c2 100644 (file)
--- a/apps/ec.c
+++ b/apps/ec.c
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC
+#ifdef OPENSSL_NO_EC
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <stdio.h>
 # include <stdlib.h>
 # include <string.h>
@@ -307,10 +310,4 @@ int ec_main(int argc, char **argv)
     OPENSSL_free(passout);
     return (ret);
 }
-#else                           /* !OPENSSL_NO_EC */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index b90247cc80d3d8d905a2b4c50621aaf9fbc1034a..7889caccefb35c8dcb147ca1a1c46801c9eade01 100644 (file)
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC
+#ifdef OPENSSL_NO_EC
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <stdio.h>
 # include <stdlib.h>
 # include <time.h>
@@ -502,10 +505,4 @@ int ecparam_main(int argc, char **argv)
     return (ret);
 }
 
-#else                           /* !OPENSSL_NO_EC */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index b10f61631da2a45a6a496299ad3418db12dc4d1f..b60bfbc29416a536c5456f697a4638ef46e7879a 100644 (file)
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "apps.h"
-#include <openssl/err.h>
-#ifndef OPENSSL_NO_ENGINE
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_ENGINE
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include "apps.h"
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <openssl/err.h>
 # include <openssl/engine.h>
 # include <openssl/ssl.h>
 
@@ -483,10 +487,4 @@ int engine_main(int argc, char **argv)
     BIO_free_all(out);
     return (ret);
 }
-#else
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index 9259c6ccaad4a7346221221a9263d468a9cbb3d3..6769968cdfae41396ddc1c82d78acefefde00af4 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
-#ifndef OPENSSL_NO_DSA
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <stdio.h>
 # include <string.h>
 # include <sys/types.h>
@@ -185,10 +188,4 @@ int gendsa_main(int argc, char **argv)
     OPENSSL_free(passout);
     return (ret);
 }
-#else                           /* !OPENSSL_NO_DSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index 33a15677114a2b015c0e3f6383f5478a855b5e21..0b0123fa1d1079ee87547bc1d6b70ad5f8482e28 100644 (file)
  */
 
 #include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_RSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-#ifndef OPENSSL_NO_RSA
 # include <stdio.h>
 # include <string.h>
 # include <sys/types.h>
@@ -232,10 +234,4 @@ static int genrsa_cb(int p, int n, BN_GENCB *cb)
     (void)BIO_flush(BN_GENCB_get_arg(cb));
     return 1;
 }
-#else                           /* !OPENSSL_NO_RSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index 810713faa84eaac63dcb0710d37c424649ca13ce..23383d93de3a32b9d8d9c875587ba08167698b66 100644 (file)
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_RSA
+#ifdef OPENSSL_NO_RSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <stdio.h>
 # include <stdlib.h>
 # include <string.h>
@@ -396,10 +399,4 @@ int rsa_main(int argc, char **argv)
     OPENSSL_free(passout);
     return (ret);
 }
-#else                           /* !OPENSSL_NO_RSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index beb03eb8dc669867f783d32540fd73b2e67bedbe..f3c90b77c66e79fd9791746df009e57094f58e07 100644 (file)
@@ -57,7 +57,9 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_RSA
+#ifdef OPENSSL_NO_RSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # include "apps.h"
 # include <string.h>
@@ -319,11 +321,4 @@ int rsautl_main(int argc, char **argv)
     OPENSSL_free(passin);
     return ret;
 }
-
-#else                           /* !OPENSSL_NO_RSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index c3e4f439fba7bec6a1638099068bd3729084dc8c..2c4d746f88e56a4251398ebac4c782dafa0281e2 100644 (file)
  * Hudson (tjh@cryptsoft.com).
  *
  */
+
 #include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_SRP
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-#ifndef OPENSSL_NO_SRP
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <openssl/conf.h>
-#include <openssl/bio.h>
-#include <openssl/err.h>
-#include <openssl/txt_db.h>
-#include <openssl/buffer.h>
-#include <openssl/srp.h>
-#include "apps.h"
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <openssl/conf.h>
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/txt_db.h>
+# include <openssl/buffer.h>
+# include <openssl/srp.h>
+# include "apps.h"
 
 # define BASE_SECTION    "srp"
 # define CONFIG_FILE "openssl.cnf"
@@ -653,11 +656,4 @@ int srp_main(int argc, char **argv)
     OBJ_cleanup();
     return (ret);
 }
-
-#else
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index de98f4a1a7e8396a43795d03c5de46323a7c314d..4727e0aa75bf0caa2724f918029d9bdbec493f51 100644 (file)
@@ -33,10 +33,10 @@ GENERAL=Makefile README crypto-lib.com install.com
 LIB= $(TOP)/libcrypto.a
 SHARED_LIB= libcrypto$(SHLIB_EXT)
 LIBSRC=        cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
-       ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c fips_ers.c \
+       ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c \
        o_init.c o_fips.c mem_sec.c init.c
 LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \
-       ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o fips_ers.o \
+       ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o \
        o_init.o o_fips.o mem_sec.o init.o $(CPUID_OBJ)
 
 SRC= $(LIBSRC)
index 90ea32c52707a5d403090d16158bf89b89a4b65a..c7382bd94432afee9025759b435c982580ae1af6 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
-#include "internal/cryptlib.h"
-#ifndef OPENSSL_NO_RSA
+#include "openssl/opensslconf.h"
+#ifdef OPENSSL_NO_RSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include "internal/cryptlib.h"
+# include <stdio.h>
 # include <openssl/rsa.h>
 # include <openssl/objects.h>
 # include <openssl/asn1t.h>
@@ -103,10 +107,4 @@ IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)
 
 # endif                         /* OPENSSL_NO_RC4 */
 
-#else                           /* !OPENSSL_NO_RSA */
-
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index 9e6b08f72c7d34765f774cc83134f7de1a8eb09f..debed8dc83e8fb679fa8dcc60c7a1406ec64a1c5 100644 (file)
  * slurp this code if applications are using them directly.
  */
 
-#include <stdio.h>
-#include <time.h>
-#include "internal/cryptlib.h"
-#include "bn_lcl.h"
 #include <openssl/opensslconf.h>
-#include <openssl/rand.h>
+#if OPENSSL_API_COMPAT >= 0x00908000L
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-static void *dummy = &dummy;
+# include <stdio.h>
+# include <time.h>
+# include "internal/cryptlib.h"
+# include "bn_lcl.h"
+# include <openssl/rand.h>
 
-#if OPENSSL_API_COMPAT < 0x00908000L
 BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
                           const BIGNUM *add, const BIGNUM *rem,
                           void (*callback) (int, int, void *), void *cb_arg)
index c54c6feb51b560602b163c7639351afb85a17ec8..7fb70e4afdacc575122f2c70a759ef2809499e47 100644 (file)
@@ -42,7 +42,9 @@
 
 #include "rsaz_exp.h"
 
-#ifdef RSAZ_ENABLED
+#ifndef RSAZ_ENABLED
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 /*
  * See crypto/bn/asm/rsaz-avx2.pl for further details.
@@ -337,10 +339,4 @@ void RSAZ_512_mod_exp(BN_ULONG result[8],
     OPENSSL_cleanse(storage, sizeof(storage));
 }
 
-#else
-
-# if defined(PEDANTIC) || defined(__DECC) || defined(__clang__)
-static void *dummy = &dummy;
-# endif
-
 #endif
index f8ae4bd4628d84a4357a79ebdcd9c774d13d4fd1..90f301a327b997698364a9b5ac5664922048b9d1 100644 (file)
@@ -1,7 +1,7 @@
 LIBS=../libcrypto
 SOURCE[../libcrypto]=\
         cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
-        ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c fips_ers.c \
+        ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c \
         o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -}
 EXTRA=  ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \
         x86cpuid.pl x86_64cpuid.pl ia64cpuid.S \
index b31564ff9c26d4a3c1aa145c907be75e0e94618d..12b820432b3b294053477ed9ec53ea7c77ed6730 100644 (file)
@@ -217,7 +217,7 @@ $!
 $! Define The Different Encryption "library" Strings.
 $!
 $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,"+ -
-       "ebcdic,uid,o_time,o_str,o_dir,thr_id,lock,fips_ers,"+ -
+       "ebcdic,uid,o_time,o_str,o_dir,thr_id,lock,"+ -
        "o_init,o_fips"
 $ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err,obj_xref"
 $ LIB_MD2 = "md2_dgst,md2_one"
index 4b38570d5e8c8e3cd5051e7f552c04a8d0a07950..90ce0b0d89e5ffaa735a16111a09733c57026560 100644 (file)
 
 /* This file contains deprecated functions as wrappers to the new ones */
 
-#include <stdio.h>
-#include "internal/cryptlib.h"
-#include <openssl/bn.h>
-#include <openssl/dh.h>
 #include <openssl/opensslconf.h>
+#if OPENSSL_API_COMPAT >= 0x00908000L
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-static void *dummy = &dummy;
+# include <stdio.h>
+# include "internal/cryptlib.h"
+# include <openssl/bn.h>
+# include <openssl/dh.h>
 
-#if OPENSSL_API_COMPAT < 0x00908000L
 DH *DH_generate_parameters(int prime_len, int generator,
                            void (*callback) (int, int, void *), void *cb_arg)
 {
index e02c10296c533c4250d466f6556d5324b584962c..f50fcc01ee0b083b8e44398682ef372d80caff21 100644 (file)
  */
 #define xxxHASH    EVP_sha1()
 
-static void *dummy = &dummy;
-
-#include <stdio.h>
-#include <time.h>
-#include "internal/cryptlib.h"
-#include <openssl/evp.h>
-#include <openssl/bn.h>
-#include <openssl/dsa.h>
-#include <openssl/rand.h>
-#include <openssl/sha.h>
 #include <openssl/opensslconf.h>
+#if OPENSSL_API_COMPAT >= 0x00908000L
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <time.h>
+# include "internal/cryptlib.h"
+# include <openssl/evp.h>
+# include <openssl/bn.h>
+# include <openssl/dsa.h>
+# include <openssl/rand.h>
+# include <openssl/sha.h>
 
-#if OPENSSL_API_COMPAT < 0x00908000L
 DSA *DSA_generate_parameters(int bits,
                              unsigned char *seed_in, int seed_len,
                              int *counter_ret, unsigned long *h_ret,
index 0f1255a4707db3c2e7c6433228e3cae0076a2dce..1248cba2607026a5cd5c8d5dc749d1e786a6f9dd 100644 (file)
@@ -1,14 +1,11 @@
 
-#ifndef CHARSET_EBCDIC
-
 # include <openssl/e_os2.h>
-# if defined(PEDANTIC) || defined(__DECC) || defined(OPENSSL_SYS_MACOSX) || defined(__clang__)
-static void *dummy = &dummy;
-# endif
-
-#else                           /* CHARSET_EBCDIC */
+#ifndef CHARSET_EBCDIC
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # include "ebcdic.h"
+
 /*-
  *      Initial Port for  Apache-1.3     by <Martin.Kraemer@Mch.SNI.De>
  *      Adapted for       OpenSSL-0.9.4  by <Martin.Kraemer@Mch.SNI.De>
index 173ef5faea629369481c477d47b448c7b5ae07b2..a76b60fc31c3c0d712b62857f8e4d74e8d4d28cb 100644 (file)
@@ -25,7 +25,9 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+#ifdef OPENSSL_NO_EC_NISTP_64_GCC_128
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # include <stdint.h>
 # include <string.h>
@@ -1677,6 +1679,4 @@ int ec_GFp_nistp224_have_precompute_mult(const EC_GROUP *group)
     return HAVEPRECOMP(group, nistp224);
 }
 
-#else
-static void *dummy = &dummy;
 #endif
index 9e33acf0cdf863bd26006a2fd8cf53958ddc79f1..d4bff1ad6d9aa07f8b60a0a6a2d41c87f8cfb6e6 100644 (file)
@@ -26,7 +26,9 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+#ifdef OPENSSL_NO_EC_NISTP_64_GCC_128
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # include <stdint.h>
 # include <string.h>
@@ -2311,6 +2313,4 @@ int ec_GFp_nistp256_have_precompute_mult(const EC_GROUP *group)
 {
     return HAVEPRECOMP(group, nistp256);
 }
-#else
-static void *dummy = &dummy;
 #endif
index 4fff85a7e68f8f90fac3e776d0fdca14dbc2b1c5..de61a8ab5e4abb6a9170368ab7c1381b3c279439 100644 (file)
@@ -26,7 +26,9 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+#ifdef OPENSSL_NO_EC_NISTP_64_GCC_128
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 # ifndef OPENSSL_SYS_VMS
 #  include <stdint.h>
@@ -2106,6 +2108,4 @@ int ec_GFp_nistp521_have_precompute_mult(const EC_GROUP *group)
     return HAVEPRECOMP(group, nistp521);
 }
 
-#else
-static void *dummy = &dummy;
 #endif
index 67808e2a6dd8474e4d5cdaa5a81897f69e25d961..01c88d8e5b6f84352e501e8bc480aa1fb29d52b2 100644 (file)
@@ -18,7 +18,9 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+#ifdef OPENSSL_NO_EC_NISTP_64_GCC_128
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
 /*
  * Common utility functions for ecp_nistp224.c, ecp_nistp256.c, ecp_nistp521.c.
@@ -212,6 +214,4 @@ void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign,
     *sign = s & 1;
     *digit = d;
 }
-#else
-static void *dummy = &dummy;
 #endif
index 924df8d0ec2d0f4587b553d937ab36ff1cbbe74f..8ebd2267620dc781e9ae611b63276d145e155bd8 100644 (file)
  */
 
 #include <openssl/opensslconf.h>
-#ifndef OPENSSL_NO_CAMELLIA
+#ifdef OPENSSL_NO_CAMELLIA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
 # include <openssl/evp.h>
 # include <openssl/err.h>
 # include <string.h>
@@ -402,10 +405,4 @@ static int camellia_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 BLOCK_CIPHER_generic_pack(NID_camellia, 128, 0)
     BLOCK_CIPHER_generic_pack(NID_camellia, 192, 0)
     BLOCK_CIPHER_generic_pack(NID_camellia, 256, 0)
-#else
-
-# ifdef PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index 759856a8ebae53c50f534a101321a32060897e70..c3185377dc5c7defd2853f6bb932fd5f39b88f15 100644 (file)
@@ -57,9 +57,8 @@
  */
 
 #include <openssl/opensslconf.h>
-
 #if OPENSSL_API_COMPAT >= 0x00908000L
-static void *dummy = &dummy;
+NON_EMPTY_TRANSLATION_UNIT
 #else
 
 # include <openssl/evp.h>
index 41a721eea5790018ed111d9b0e3d2cb814572247..7f9c7337b2c025f26b73e8aeeb6ce6cc69cc7679 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#include <stdio.h>
 #include "internal/cryptlib.h"
+#ifdef OPENSSL_NO_RSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
 
-#ifndef OPENSSL_NO_RSA
-
+# include <stdio.h>
 # include <openssl/evp.h>
 # include <openssl/objects.h>
 # include <openssl/x509.h>
@@ -117,10 +118,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
         i = EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL);
     return (i);
 }
-#else                           /* !OPENSSL_NO_RSA */
-
-# ifdef PEDANTIC
-static void *dummy = &dummy;
-# endif
-
 #endif
index 1788ed288487a7a4935f51af039d49f2d56f3385..ad6935f7fe961cd3e9732c649bb6bda810ec81fb 100644 (file)
@@ -1,7 +1,7 @@
 #include <openssl/opensslconf.h>
 
-#ifdef OPENSSL_FIPS
-# include "fips_err.h"
+#ifndef OPENSSL_FIPS
+NON_EMPTY_TRANSLATION_UNIT
 #else
-static void *dummy = &dummy;
+# include "fips_err.h"
 #endif
index f0d2e55a48bd924f8aa84ef06a5855339cad6a49..6f13717b5ac190b73d7f9712015344f4bfa77b94 100644 (file)
  *
  */
 
-#include <openssl/crypto.h>
-#include <openssl/e_os2.h>
-#include <openssl/rand.h>
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_EGD
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <openssl/crypto.h>
+# include <openssl/e_os2.h>
+# include <openssl/rand.h>
 
 /*-
  * Query the EGD <URL: http://www.lothar.com/tech/crypto/>.
@@ -94,8 +99,6 @@
  *   RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
  */
 
-#ifndef OPENSSL_NO_EGD
-
 # if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_UEFI)
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
 {
@@ -288,8 +291,4 @@ int RAND_egd(const char *path)
 
 # endif
 
-#else /* OPENSSL_NO_EGD */
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
 #endif
index 50b0bb697e9ee18f2069efe58b4be84f0f0e11f5..18e406594a76f3a555917ed761ef1cc0eca98844 100644 (file)
  * "new" versions).
  */
 
-#include <stdio.h>
-#include <time.h>
-#include "internal/cryptlib.h"
 #include <openssl/opensslconf.h>
-#include <openssl/bn.h>
-#include <openssl/rsa.h>
-
 #if OPENSSL_API_COMPAT >= 0x00908000L
-
-static void *dummy = &dummy;
+NON_EMPTY_TRANSLATION_UNIT
 
 #else
 
+# include <stdio.h>
+# include <time.h>
+# include "internal/cryptlib.h"
+# include <openssl/bn.h>
+# include <openssl/rsa.h>
+
 RSA *RSA_generate_key(int bits, unsigned long e_value,
                       void (*callback) (int, int, void *), void *cb_arg)
 {
index 2ba1599cd0853451d14819a16b184ad0bb9b6120..c22209bdc3271e8a66292d632cca38856adf49b5 100644 (file)
@@ -71,6 +71,12 @@ EOF
     "";
 -}
 
+/*
+ * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
+ * don't like that.  This will hopefully silence them.
+ */
+#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
+
 /*
  * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
  * declarations of functions deprecated in or before <version>. Otherwise, they