Move __STDC_FORMAT_MACROS to build system

__STDC_FORMAT_MACROS changes the behavior of inttypes.h to allow
defining format macros for printf-like functions. It needs to be defined
before any include is done, otherwise due to include chains and header
guards it may not take effect.

Instead of having to define it everywhere it is used, move the define to the
build system. Also update ecl and DriverFramework submodules to deal with the
changed definitions.
This commit is contained in:
Lucas De Marchi
2016-07-07 18:06:43 -03:00
committed by Lorenz Meier
parent d2194d787f
commit 18330f7ab7
18 changed files with 3 additions and 17 deletions
-1
View File
@@ -115,7 +115,6 @@ print("""
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#ifndef PRIu64
+1
View File
@@ -787,6 +787,7 @@ function(px4_add_common_flags)
string(REPLACE "-" "_" board_config ${board_upper})
set(added_definitions
-DCONFIG_ARCH_BOARD_${board_config}
-D__STDC_FORMAT_MACROS
)
if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")))
-1
View File
@@ -41,7 +41,6 @@
#include <sys/types.h>
#include <stdbool.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <px4_time.h>
-1
View File
@@ -41,7 +41,6 @@
#ifndef I2C_FRAME_H_
#define I2C_FRAME_H_
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
typedef struct i2c_frame {
-1
View File
@@ -39,7 +39,6 @@
#pragma once
#define __STDC_FORMAT_MACROS
#include <stdint.h>
#include <inttypes.h>
-1
View File
@@ -33,7 +33,6 @@
#pragma once
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
/**
-1
View File
@@ -40,7 +40,6 @@
#include <px4_config.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdlib.h>
-1
View File
@@ -61,7 +61,6 @@ do {
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
#else
#define __STDC_FORMAT_MACROS
#include <inttypes.h> /* uint32_t */
#endif
@@ -36,7 +36,6 @@
* Driver for the simulated barometric pressure sensor
*/
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <px4_config.h>
#include <px4_defines.h>
@@ -37,7 +37,6 @@
*/
#include <sys/types.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
@@ -41,7 +41,6 @@
* @author Mark Charlebois
*/
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <px4_config.h>
-1
View File
@@ -45,7 +45,6 @@
#include <semaphore.h>
#include <time.h>
#include <string.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <errno.h>
#include "hrt_work.h"
-1
View File
@@ -118,7 +118,6 @@ static inline void do_nothing(int level, ...)
#else
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdint.h>
#include <sys/cdefs.h>
-1
View File
@@ -48,7 +48,6 @@
/* includes when building for ros */
#include "ros/ros.h"
#include <list>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <type_traits>
#else
-1
View File
@@ -37,7 +37,6 @@
* Tests for the bson en/decoder
*/
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <px4_defines.h>
-1
View File
@@ -36,7 +36,6 @@
* Included Files
****************************************************************************/
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <px4_config.h>