build: restore externs 937/head
authorRichard Russon <rich@flatcap.org>
Thu, 9 Nov 2017 12:35:02 +0000 (12:35 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 30 Nov 2017 12:58:23 +0000 (12:58 +0000)
The MacOS build failed, with linker errors for libconn's global
variables.

By initialising them, we hope to force the linker to use them.

conn/conn_globals.c
conn/conn_globals.h

index 2f8ef5115f5a500c974d825a16c0f6a031e1c6d7..22de6a3d9b7f8c0049eeb19458a5a3e1732c2468 100644 (file)
  */
 
 #include "config.h"
+#include <stdio.h>
 
-short ConnectTimeout; /**< Config: $connect_timeout */
+short ConnectTimeout = 0; /**< Config: $connect_timeout */
 
 #ifdef USE_SSL
-const char *CertificateFile; /**< Config: $certificate_file */
-const char *EntropyFile;     /**< Config: $entropy_file */
-const char *SslCiphers;      /**< Config: $ssl_ciphers */
-const char *SslClientCert;   /**< Config: $ssl_client_cert */
+const char *CertificateFile = NULL; /**< Config: $certificate_file */
+const char *EntropyFile = NULL;     /**< Config: $entropy_file */
+const char *SslCiphers = NULL;      /**< Config: $ssl_ciphers */
+const char *SslClientCert = NULL;   /**< Config: $ssl_client_cert */
 #ifdef USE_SSL_GNUTLS
-const char *SslCaCertificatesFile; /**< Config: $ssl_ca_certificates_file */
-short SslMinDhPrimeBits;           /**< Config: $ssl_min_dh_prime_bits */
+const char *SslCaCertificatesFile = NULL; /**< Config: $ssl_ca_certificates_file */
+short SslMinDhPrimeBits = 0;              /**< Config: $ssl_min_dh_prime_bits */
 #endif
 #endif
 
 #ifdef USE_SOCKET
-const char *Preconnect; /**< Config: $preconnect */
-const char *Tunnel;     /**< Config: $tunnel */
-#endif                  /* USE_SOCKET */
+const char *Preconnect = NULL; /**< Config: $preconnect */
+const char *Tunnel = NULL;     /**< Config: $tunnel */
+#endif
index 1b52c0b05551bbc0e4bfb0bae2e69df317dccbff..5b8d4e1632219103ea56f88f719ea0139213f80f 100644 (file)
 short ConnectTimeout;
 
 #ifdef USE_SSL
-const char *CertificateFile;
-const char *EntropyFile;
-const char *SslCiphers;
-const char *SslClientCert;
+extern const char *CertificateFile;
+extern const char *EntropyFile;
+extern const char *SslCiphers;
+extern const char *SslClientCert;
 #ifdef USE_SSL_GNUTLS
-const char *SslCaCertificatesFile;
+extern const char *SslCaCertificatesFile;
 short SslMinDhPrimeBits;
 #endif
 #endif
 
 #ifdef USE_SOCKET
-const char *Preconnect;
-const char *Tunnel;
+extern const char *Preconnect;
+extern const char *Tunnel;
 #endif
 
 #endif /* _CONN_GLOBALS_H */