Intuition and INLINE kludges

2 posts / 0 new
Last post
kas1e
kas1e's picture
Offline
Last seen: 1 month 1 week ago
Joined: 2010-11-30 15:30
Intuition and INLINE kludges
In one heavy project i working on, there is such kind of code present:
  1. enum EDisplay {
  2. INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT,
  3. NONE
  4. };
Lately, those enums used there and there, so , that "INLINE" word better to stay here. Then, i found just once i just add include of intution (proto/intuition.h, or just intuition/classusr.h), then i have some heavy inline related errors. So, test code is:
  1. // any of includes give same errors
  2. #include <proto/intuition.h>
  3. //#include <intuition/classusr.h>
  4.  
  5. enum EDisplay {
  6. INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT,
  7. NONE
  8. };
  9.  
  10.  
  11. main()
  12. {
  13.  
  14. }
And compile pure "g++ test.c" , or "g++ -D__USE_INLINE__ test.c" give me that kind of error on such simple test case:
# g++ -c test.cpp test.cpp:7: error: expected identifier before 'inline' test.cpp:7: error: expected '}' before 'inline' test.cpp:7: error: expected unqualified-id before ',' token test.cpp:7: error: 'BLOCK' declared as an 'inline' variable test.cpp:7: error: 'LIST_ITEM' declared as an 'inline' variable test.cpp:7: error: 'RUN_IN' declared as an 'inline' variable test.cpp:7: error: 'COMPACT' declared as an 'inline' variable test.cpp:9: error: expected initializer before '}' token test.cpp:9: error: expected declaration before '}' token
When make file as pure .c and compile it via gcc (not g++), then still errors, just not so verbose. Problem is: i need to have INLINE in that enum, and i need to include intuition/classusr.h to be able to use intuition's objects. The only way i found to avoid errors, its just after including of intuition proto do #undef INLINE , but that of course wrong, as just broken all code related to, and in real project its .h which have such enum, and which includes everywhere, so its kind of hardcore imho. Any ideas ? I think of course about just do search in all the sources on upper case INLINE, and replace them all on INLINE_A, but dunno, if that only way (and there is hundreds of files with).
salass00
salass00's picture
Offline
Last seen: 1 month 1 week ago
Joined: 2011-02-03 11:27
Add -DINLINE=INLINE to the
Add -DINLINE=INLINE to the compiler options. This will disable the INLINE define in <amiga_compiler.h>.
Log in or register to post comments