Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
Diff: azure_c_shared_utility/macro_utils.h
- Revision:
- 10:1be0bc9a9deb
- Parent:
- 0:fa2de1b79154
- Child:
- 12:72001533b0e3
--- a/azure_c_shared_utility/macro_utils.h Fri Aug 12 13:49:58 2016 -0700 +++ b/azure_c_shared_utility/macro_utils.h Fri Aug 26 12:59:40 2016 -0700 @@ -10,6 +10,9 @@ #include <string.h> +/*"pointer or NULL" macro - because when printf-ing arguments NULL is not valid for %p or %s (section 7.1.4 of C11 standard) */ +#define P_OR_NULL(p) (((p)!=NULL)?(p):"NULL") + #define TOSTRING_(x) #x #define TOSTRING(x) TOSTRING_(x) @@ -4765,14 +4768,13 @@ -#define FOR_EACH_2_KEEP_1_2(X, keep, P1, P2) \ - X(keep, P1, P2) \ - - #define FOR_EACH_2_KEEP_1_1(...) #define FOR_EACH_2_KEEP_1_0(...) +#define FOR_EACH_2_KEEP_1_2(X, keep, P1, P2) \ + X(keep, P1, P2) \ + #ifdef _MSC_VER #define FOR_EACH_2_KEEP_1(MACRO_TO_INVOKE, ...) C2(FOR_EACH_2_KEEP_1_, C2(DEC,C1(COUNT_ARG(__VA_ARGS__)))) LPAREN MACRO_TO_INVOKE, __VA_ARGS__) #else