The problem of adapting MSVC ++ code for C ++ Builder -__ declspec (align (n))

I have a huge problem adapting code in C ++ Builder.

What is the equivalent in C ++ Builder for __declspec (align (n))? I do not mean #pragma pack ([show] | [push | pop] [, identifier], n). I need something for the macro.

I have a problem accepting the code below (especially for __declspec(align(n))):

#elif defined(_MSC_VER)

#define LJ_NORET    __declspec(noreturn)
#define LJ_ALIGN(n) __declspec(align(n))
#define LJ_INLINE   __inline
#define LJ_AINLINE  __forceinline
#define LJ_NOINLINE __declspec(noinline)
#if defined(_M_IX86)
#define LJ_FASTCALL __fastcall
#endif

static LJ_AINLINE uint32_t lj_ffs(uint32_t x)
{
  uint32_t r; _BitScanForward(&r, x); return r;
}

static LJ_AINLINE uint32_t lj_fls(uint32_t x)
{
  uint32_t r; _BitScanReverse(&r, x); return r;
}

#define lj_bswap(x) (_byteswap_ulong((x)))

#else
+3
source share
1 answer

The [[align]] attribute is not yet implemented in C ++ Builder. I'm not sure where this is on the priority list for C ++ 0x support.

+1
source

Source: https://habr.com/ru/post/1733812/


All Articles