corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject incubator-corinthia git commit: Fix OS X build breakage in DFError.h
Date Sat, 10 Jan 2015 17:55:51 GMT
Repository: incubator-corinthia
Updated Branches:
  refs/heads/master 3f11aefa2 -> cc208a6d4

Fix OS X build breakage in DFError.h

Commit e8d93d4 removed the ATTRIBUTE_FORMAT macro from DFError.h, since
this macro is also present in DFPlatform.h. However, DFError.h is part
of the public API, while DFPlatform is not. Consumers that are
configured to compile only against the public API are unable to access
macro definitions in DFPlatform.h, so those macros must be present in
the API headers.

The ATTRIBUTE_FORMAT is used for telling the compiler to check the
arguments to DFErrorFormat to make sure they conform to printf-style
formatting. GCC/Clang and Visual C++ both have a different syntax for
this, which is why a macro is needed.

I'm not sure why gcc on Linux and Visual C++ on windows weren't
complaining about this, but Xcode gave a compile error as the macro was

If we want to avoid platform-specific #ifdefs in specific public header
files, we'll need something equivalent to DFPlatform.h which is included
in the public headers. Putting this #ifdef back as-is is a temporary
solution, needed to build the code under Xcode, but ultimately it would
be good if we could come up with a more general solution.


Branch: refs/heads/master
Commit: cc208a6d44534fea95a5fa2f4bcc7f733b58fd89
Parents: 3f11aef
Author: Peter Kelly <>
Authored: Sun Jan 11 00:48:26 2015 +0700
Committer: Peter Kelly <>
Committed: Sun Jan 11 00:52:52 2015 +0700

 DocFormats/api/headers/DocFormats/DFError.h | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/DocFormats/api/headers/DocFormats/DFError.h b/DocFormats/api/headers/DocFormats/DFError.h
index 5b08fb1..2876007 100644
--- a/DocFormats/api/headers/DocFormats/DFError.h
+++ b/DocFormats/api/headers/DocFormats/DFError.h
@@ -19,6 +19,13 @@
 // It's really not nice having this here, but is the only way to get the compiler to typecheck
 // DFErrorFormat arguments when such functionality is available.
+#ifdef _MSC_VER
+#define ATTRIBUTE_FORMAT(archetype,index,first)
+#define ATTRIBUTE_FORMAT(archetype,index,first) __attribute__((format(archetype,index,first)))
 typedef struct DFError DFError;

View raw message