Fix AIX compilation error related to printf macros
authorMike Seplowitz <mseplowitz@bloomberg.net>
Tue, 13 Jan 2015 00:13:39 +0000 (19:13 -0500)
committerMike Seplowitz <mseplowitz@bloomberg.net>
Wed, 19 Aug 2015 12:43:58 +0000 (08:43 -0400)
On AIX, inttypes.h gets indirectly included by build_log.h.
It's easiest just to ask for the printf format macros right away.

src/build_log.cc

index 589c6da..8a52514 100644 (file)
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+// On AIX, inttypes.h gets indirectly included by build_log.h.
+// It's easiest just to ask for the printf format macros right away.
+#ifndef _WIN32
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
+#endif
+#endif
+
 #include "build_log.h"
 
 #include <errno.h>
@@ -19,9 +27,6 @@
 #include <string.h>
 
 #ifndef _WIN32
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
 #include <inttypes.h>
 #include <unistd.h>
 #endif