typedef enum BeNeLux
{
BELGIUM,
NETHERLANDS,
LUXEMBURG
} _ASSOCIATIONS_ BeNeLux;
When I try to compile this using the C ++ compiler, I get errors, but it seems to work fine with the C compiler. So here is the question. Is it possible to package an enumeration in C ++, or can anyone understand why I got the error?
Error:
"after the declaration BeNeLux with a comma is missing.
I know after checking and re-checking that there is definitely a semicolon and in any places required in the rest of the code.
Application:
_PACKAGE_was just an example. I rename it.
_ASSOCIATIONS_ not a BeNeLux type:
#define _ASSOCIATIONS_ __attribute__((packed))
The iffed code, but only to make sure it is GNU C / C ++.
#if defined (__GNUC__)
#define _ASSOCIATIONS_ __attribute__((packed))
#else
#define _ASSOCIATIONS_
Will this cause problems? I thought ( GNUC ) worked for both C and C ++
Addendum 2:
I even tried
#ifdef __cplusplus
extern "C" {
#endif
typedef enum BeNeLux
{
BELGIUM,
NETHERLANDS,
LUXEMBURG
} _ASSOCIATIONS_ BeNeLux;
#ifdef __cplusplus
}
#endif
There is no joy. Is anyone
: -fshort-enums ; .