2019-09-23 18:56:05 +00:00
|
|
|
#ifndef __BASICS_H
|
|
|
|
#define __BASICS_H
|
|
|
|
|
2019-10-28 22:46:15 +00:00
|
|
|
#ifndef MAKE_ID
|
|
|
|
#ifndef __BIG_ENDIAN__
|
|
|
|
#define MAKE_ID(a,b,c,d) ((uint32_t)((a)|((b)<<8)|((c)<<16)|((d)<<24)))
|
|
|
|
#else
|
|
|
|
#define MAKE_ID(a,b,c,d) ((uint32_t)((d)|((c)<<8)|((b)<<16)|((a)<<24)))
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2019-09-23 18:56:05 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define GCCPRINTF(stri,firstargi) __attribute__((format(printf,stri,firstargi)))
|
|
|
|
#define GCCFORMAT(stri) __attribute__((format(printf,stri,0)))
|
|
|
|
#define GCCNOWARN __attribute__((unused))
|
|
|
|
#else
|
|
|
|
#define GCCPRINTF(a,b)
|
|
|
|
#define GCCFORMAT(a)
|
|
|
|
#define GCCNOWARN
|
|
|
|
#endif
|
|
|
|
|
2019-10-28 22:46:15 +00:00
|
|
|
template <typename T, size_t N>
|
|
|
|
char(&_ArraySizeHelper(T(&array)[N]))[N];
|
|
|
|
|
|
|
|
#define countof( array ) (sizeof( _ArraySizeHelper( array ) ))
|
2019-09-23 18:56:05 +00:00
|
|
|
|
|
|
|
#endif
|