diff -r e3fbf97d2021 -r da78d0d93c75 lib/iec_types_all.h --- a/lib/iec_types_all.h Thu Jun 16 11:14:13 2011 +0100 +++ b/lib/iec_types_all.h Mon Jun 27 18:01:43 2011 +0200 @@ -32,7 +32,7 @@ IEC_##type fvalue;\ } __IEC_##type##_p; -#define __DECLARE_DERIVED_TYPE(base, type)\ +#define __DECLARE_DERIVED_TYPE(type, base)\ typedef base type;\ typedef __IEC_##base##_t __IEC_##type##_t; @@ -47,15 +47,23 @@ IEC_BYTE flags;\ } __IEC_##type##_p; -#define __DECLARE_ARRAY_TYPE(base, type, size)\ +#define __DECLARE_ENUMERATED_TYPE(type, ...)\ +typedef enum {\ + __VA_ARGS__\ +} type;\ +__DECLARE_COMPLEX_STRUCT(type) + +#define __DECLARE_ARRAY_TYPE(type, base, size)\ typedef struct {\ base table size;\ } type;\ -__DECLARE_COMPLEX_STRUCT(type); +__DECLARE_COMPLEX_STRUCT(type) -#define __DECLARE_STRUCT_TYPE(elements, type)\ -typedef elements type;\ -__DECLARE_COMPLEX_STRUCT(type); +#define __DECLARE_STRUCT_TYPE(type, elements)\ +typedef struct {\ + elements\ +} type;\ +__DECLARE_COMPLEX_STRUCT(type) /* Those typdefs clash with windows.h */ /* i.e. this file cannot be included aside windows.h */