Fix explicit de-init macros
authorMatt Caswell <matt@openssl.org>
Wed, 6 Apr 2016 10:12:12 +0000 (11:12 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 13 Apr 2016 07:59:03 +0000 (08:59 +0100)
The no-op de-init macros may fail because of extraneous ";", so we use
a slightly different construct instead.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
include/openssl/bio.h
include/openssl/comp.h
include/openssl/conf.h
include/openssl/crypto.h
include/openssl/engine.h
include/openssl/err.h
include/openssl/evp.h
include/openssl/objects.h
include/openssl/rand.h
include/openssl/ssl.h

index 97a3d9d46c5377d8290cf3dfe5add763957f3886..a168be085df42fe2e7c65e83cd026d17604ef904 100644 (file)
@@ -696,7 +696,7 @@ int BIO_socket_ioctl(int fd, long type, void *arg);
 int BIO_socket_nbio(int fd, int mode);
 int BIO_sock_init(void);
 #if OPENSSL_API_COMPAT < 0x10100000L
-# define BIO_sock_cleanup()
+# define BIO_sock_cleanup() while(0) continue
 #endif
 int BIO_set_tcp_ndelay(int sock, int turn_on);
 
index bfdadce1a146fdccdc5a4b44ee74bff6c32b3a56..d2537f8d560b0e91752c4863a3a3085239184268 100644 (file)
@@ -81,7 +81,7 @@ int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
 COMP_METHOD *COMP_zlib(void);
 
 #if OPENSSL_API_COMPAT < 0x10100000L
-#define COMP_zlib_cleanup()
+#define COMP_zlib_cleanup() while(0) continue
 #endif
 
 # ifdef HEADER_BIO_H
index 29189d054721d36fa58e3242fc64b62f2389f164..5f7f54707aa38ede060dc328c4c96b8d791167cb 100644 (file)
@@ -187,7 +187,7 @@ int CONF_modules_load_file(const char *filename, const char *appname,
 void CONF_modules_unload(int all);
 void CONF_modules_finish(void);
 #if OPENSSL_API_COMPAT < 0x10100000L
-# define CONF_modules_free()
+# define CONF_modules_free() while(0) continue
 #endif
 int CONF_module_add(const char *name, conf_init_func *ifunc,
                     conf_finish_func *ffunc);
index d0ec86a46c8ba70bed1352d8cfdffc1f29018571..32b88439f2fe655492abfbc374c56f6ad704ecfe 100644 (file)
@@ -303,7 +303,7 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
  * This function cleans up all "ex_data" state. It mustn't be called under
  * potential race-conditions.
  */
-# define CRYPTO_cleanup_all_ex_data()
+# define CRYPTO_cleanup_all_ex_data() while(0) continue
 
 /*
  * The old locking functions have been removed completely without compatibility
index 86a42933c5f3b09019bbe8939bcaa7513f74bcdd..3123ad3a1f5eef506637f6511d1353644b6c21d4 100644 (file)
@@ -553,7 +553,7 @@ void *ENGINE_get_ex_data(const ENGINE *e, int idx);
  * This function previously cleaned up anything that needs it. Auto-deinit will
  * now take care of it so it is no longer required to call this function.
  */
-# define ENGINE_cleanup()
+# define ENGINE_cleanup() while(0) continue
 #endif
 
 /*
index deb2fe246ec531e6b950944d926f54efe90ada42..ccf2ff72deb35908d719bdec96b3cec9caa4f0e9 100644 (file)
@@ -356,7 +356,7 @@ void ERR_load_ERR_strings(void);
 #if OPENSSL_API_COMPAT < 0x10100000L
 # define ERR_load_crypto_strings() \
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
-# define ERR_free_strings()
+# define ERR_free_strings() while(0) continue
 #endif
 
 void ERR_remove_thread_state(void);
index 2cf6f14130e743b40c309ff49a2c559ec95619d7..0dabdbc26931d3f94093c94cd7e325bce68611ea 100644 (file)
@@ -912,7 +912,7 @@ const EVP_CIPHER *EVP_seed_ofb(void);
 #  define OpenSSL_add_all_digests() \
     OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
 
-#  define EVP_cleanup()
+#  define EVP_cleanup() while(0) continue
 # endif
 
 int EVP_add_cipher(const EVP_CIPHER *cipher);
index c61e49ea35e66630d164718abbf1ca36c90672fd..79e1d3dfa3a61c0906328620310f41fc2974e8dd 100644 (file)
@@ -1104,7 +1104,7 @@ int OBJ_new_nid(int num);
 int OBJ_add_object(const ASN1_OBJECT *obj);
 int OBJ_create(const char *oid, const char *sn, const char *ln);
 #if OPENSSL_API_COMPAT < 0x10100000L
-# define OBJ_cleanup()
+# define OBJ_cleanup() while(0) continue
 #endif
 int OBJ_create_objects(BIO *in);
 
index 75f7389ebd543da5f0599862aa152538f91b3220..d337ee7617adbfdde283f3e7420279157f0fb978 100644 (file)
@@ -93,7 +93,7 @@ int RAND_set_rand_engine(ENGINE *engine);
 # endif
 RAND_METHOD *RAND_OpenSSL(void);
 #if OPENSSL_API_COMPAT < 0x10100000L
-# define RAND_cleanup()
+# define RAND_cleanup() while(0) continue
 #endif
 int RAND_bytes(unsigned char *buf, int num);
 DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
index 6b66407edc1ccd0aeab0123c6a03162788748195..ef7ef568021aed59985d798cdb814dd361a27c2b 100644 (file)
@@ -1836,7 +1836,7 @@ STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
 __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
                                                       *meths);
 #if OPENSSL_API_COMPAT < 0x10100000L
-# define SSL_COMP_free_compression_methods()
+# define SSL_COMP_free_compression_methods() while(0) continue
 #endif
 __owur int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);