Typedef __xxx struct? Defines?

Hi guys,

I have a piece of code that I copied from another source but I don't understand what it means and the Keil compiler doesn't either.

The code looks like that:

#if _MSC_VER >= 1000
  #define __CIFx_PACKED_PRE
#endif

typedef __CIFx_PACKED_PRE struct DRIVER_INFORMATIONtag
{
  char       abDriverVersion[32];
  uint32_t   ulBoardCnt;
} __CIFx_PACKED_POST DRIVER_INFORMATION;

I get this error message for this typedef statement:

cifXUser.h(236): warning: #260-D: explicit type is missing ("int" assumed)
cifXUser.h(236): error: #65: expected a ";"

And acutally I haven't seen a typedef like this before... in my opinion a typedef should look like something without the "__CIFx_PACKED_PER" part.

Can you help me in configuring the compiler right (so that it compiles that) and could you tell me, what it is about here?

Thanks a lot!!!

Parents
  • Strip the #__CIFx_PACKED_PRE word.

    Or add a

    #define __CIFx_PACKED_PRE
    


    making the preprocessor strip that word on-the-fly.

    You need to check Microsoft Visual C++ documentation to figure out what they intended to do with the additional __CIFx_PACKED_PRE attribute.

    Just that the full source code must have had another #define line somewhere or some versions of Visual C++ must have had that symbol pre-defined. I would have expected the CIFx_PACKED_PRE symbol to be expanded to __packed or similar when building for some versions of VC++.

Reply
  • Strip the #__CIFx_PACKED_PRE word.

    Or add a

    #define __CIFx_PACKED_PRE
    


    making the preprocessor strip that word on-the-fly.

    You need to check Microsoft Visual C++ documentation to figure out what they intended to do with the additional __CIFx_PACKED_PRE attribute.

    Just that the full source code must have had another #define line somewhere or some versions of Visual C++ must have had that symbol pre-defined. I would have expected the CIFx_PACKED_PRE symbol to be expanded to __packed or similar when building for some versions of VC++.

Children
More questions in this forum