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:
- 42:0cc3c211ad26
- Parent:
- 24:96ae4d5375ef
- Child:
- 45:1119d0f2c4d8
diff -r dc93369d5ed4 -r 0cc3c211ad26 azure_c_shared_utility/macro_utils.h --- a/azure_c_shared_utility/macro_utils.h Mon Mar 05 17:43:09 2018 -0800 +++ b/azure_c_shared_utility/macro_utils.h Tue Mar 20 10:31:23 2018 -0700 @@ -4,7 +4,11 @@ /*THIS FILE IS GENERATED*/ /*DO NOT EDIT BY HAND!!!*/ /*instead edit macro_utils.tt here: http://www.github.com/azure/azure-macro-utils-c.git */ -/*and then copy the generated file overwriting this one*/ +/*and then propagate the generated file to all the repos*/ +/* !!! CAUTION!!! This file is copied to multiple places */ +/* in https://github.com/Azure/azure-c-shared-utility.git, */ +/* and all of these copies must be located and replaced. */ + #ifndef MACRO_UTILS_H @@ -12577,7 +12581,7 @@ #define DEFINE_ENUM_STRINGS(enumName, ...) const char* C2(enumName, StringStorage)[COUNT_ARG(__VA_ARGS__)] = {FOR_EACH_1(DEFINE_ENUMERATION_CONSTANT_AS_STRING, __VA_ARGS__)}; \ const char* C2(enumName,Strings)(enumName value) \ { \ - if((int)value<0 || (int)value>=COUNT_ARG(__VA_ARGS__)) \ + if((int)value<0 || (int)value>=COUNT_ARG(__VA_ARGS__)) \ { \ /*this is an error case*/ \ return NULL; \ @@ -12612,9 +12616,9 @@ #define DEFINE_LOCAL_ENUM(enumName, ...) typedef enum C2(enumName, _TAG) { FOR_EACH_1(DEFINE_ENUMERATION_CONSTANT, __VA_ARGS__)} enumName; \ static const char* C2(enumName, StringStorage)[COUNT_ARG(__VA_ARGS__)] = {FOR_EACH_1(DEFINE_ENUMERATION_CONSTANT_AS_STRING, __VA_ARGS__)}; \ -static const char* C2(enumName,Strings)(enumName value) \ +static const char* C2(enumName,Strings)(enumName value) \ { \ - if((int)value<0 || (int)value>=COUNT_ARG(__VA_ARGS__)) \ + if((int)value<0 || (int)value>=COUNT_ARG(__VA_ARGS__)) \ { \ /*this is an error case*/ \ return NULL; \ @@ -12625,12 +12629,13 @@ } \ } + #define ENUM_TO_STRING(enumName, enumValue) C2(enumName, Strings)(enumValue) #define STRING_TO_ENUM(stringValue, enumName, addressOfEnumVariable) C2(enumName, _FromString)(stringValue, addressOfEnumVariable) #define DEFINE_MICROMOCK_ENUM_TO_STRING(type, ...) MICROMOCK_ENUM_TO_STRING(type, FOR_EACH_1(DEFINE_ENUMERATION_CONSTANT_AS_WIDESTRING, __VA_ARGS__)); #define EMPTY() -#define DELAY(id) id EMPTY LPAREN ) +#define MACRO_UTILS_DELAY(id) id EMPTY LPAREN ) #endif /*MACRO_UTILS_H*/