git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] OS X: Fix redeclaration of die warning

From
Brian Gernhardt <brian@gernhardtsoftware.com>
Date
Aug 5, 2013, 15:59 UTC
Message-ID
<1375718364-13824-3-git-send-email-brian@gernhardtsoftware.com>
In-Reply-To
<1375718364-13824-1-git-send-email-brian@gernhardtsoftware.com>

compat/apple-common-crypto.h uses die() in one of its macros, but was included in git-compat-util.h before the definition of die.

Fix by simply moving the relevant block after the die/error/warning declarations.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
---
 Not sure if this is the best place to move it to, but it's the earliest it can
 be in the file without causing errors.  (Namely that clang has to guess what
 die() means in apple-common-crypto.h and guesses differently than the actual
 definition.)
 git-compat-util.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index af5f6bb..d60e28d 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -129,16 +129,6 @@
 #include <poll.h>
 #endif
 
-#ifndef NO_OPENSSL
-#ifdef APPLE_COMMON_CRYPTO
-#include "compat/apple-common-crypto.h"
-#else
-#include <openssl/evp.h>
-#include <openssl/hmac.h>
-#endif /* APPLE_COMMON_CRYPTO */
-#include <openssl/x509v3.h>
-#endif /* NO_OPENSSL */
-
 #if defined(__MINGW32__)
 /* pull in Windows compatibility stuff */
 #include "compat/mingw.h"
@@ -340,6 +330,16 @@ extern NORETURN void die_errno(const char *err, ...) __attribute__((format (prin
 extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
 extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
 
+#ifndef NO_OPENSSL
+#ifdef APPLE_COMMON_CRYPTO
+#include "compat/apple-common-crypto.h"
+#else
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
+#endif /* APPLE_COMMON_CRYPTO */
+#include <openssl/x509v3.h>
+#endif /* NO_OPENSSL */
+
 /*
  * Let callers be aware of the constant return value; this can help
  * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
-- 
1.8.4.rc1.384.g0976a17.dirty
Previous: Junio C HamanoNext: Jeremy Huddleston Sequoia
Message 7 of 12 in “Fixes for OS X”
  1. 0/3 Fixes for OS XBrian Gernhardt, Aug 5, 2013
  2. 1/3 Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1Brian Gernhardt, Aug 5, 2013
  3. Jeremy Huddleston SequoiaAug 5, 2013
  4. Junio C HamanoAug 5, 2013
  5. David AguilarAug 6, 2013
  6. Junio C HamanoAug 6, 2013
  7. 2/3 OS X: Fix redeclaration of die warningBrian Gernhardt, Aug 5, 2013
  8. Jeremy Huddleston SequoiaAug 5, 2013
  9. Junio C HamanoAug 5, 2013
  10. David AguilarAug 6, 2013
  11. 3/3 t5551: Remove header from curl cookie fileBrian Gernhardt, Aug 5, 2013
  12. Dave BorowitzAug 6, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.