graphitemaster / incbin

Include binary files in C/C++
The Unlicense
938 stars 87 forks source link

incbin doesn't work in arm compiler 5 (armcc) #59

Open GorgonMeducer opened 1 year ago

GorgonMeducer commented 1 year ago

When I test the incbin in arm compiler 5 with the following code:

#define INCBIN_PREFIX
#define INCBIN_STYLE INCBIN_STYLE_SNAKE
#include "incbin.h"

INCBIN(HOTEL_MP3_ROM, "hotel.mp3");

I get following error message:

error:  #412: an "asm" declaration is not allowed here
  INCBIN(HOTEL_MP3_ROM, "hotel.mp3");

The arm compiler 5 version is V5.06 update 7 (build 960).

Please help.

By the way, the official method to detect arm compiler 5 and arm compiler 6 is as following:

// for arm compiler 5
#undef __IS_COMPILER_ARM_COMPILER_5__
#if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000))
#   define __IS_COMPILER_ARM_COMPILER_5__       1
#endif

//for arm compiler 6

#undef __IS_COMPILER_ARM_COMPILER_6__
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#   define __IS_COMPILER_ARM_COMPILER_6__       1
#endif

I hope this helps.