|
Re: syntax error for preprocessor macro, even after defining symbol [message #790204 is a reply to message #631544] |
Fri, 03 February 2012 23:51 |
Vynce - Messages: 6 Registered: January 2012 |
Junior Member |
|
|
I realize that this is an old thread, but I'm running into exactly the same issue on an embedded ARM project.
It's possible to work around the issue with some preprocessor magic, but it would be nice if there was some way to just tell Eclipse/CDT to ignore the __packed keyword somehow. We've got __packed keywords scattered all over the place and it would be quite an undertaking to replace all of them just to make Eclipse index the structures.
Any ideas?
// Define NO_PACKED_SUPPORT in Eclipse and leave
// it undefined for hardware builds.
#ifdef NO_PACKED_SUPPORT
#define PACKED
#define PACKED_STRUCT struct
#else
#define PACKED __packed
#define PACKED_STRUCT __packed_struct
#endif
typedef PACKED struct {
char x;
int y;
} MY_STRUCT;
typedef PACKED_STRUCT {
char x;
int y;
} MY_STRUCT2;
[Updated on: Sat, 04 February 2012 00:02] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03954 seconds