sf64/include/alignment.h
Alejandro Asenjo Nitti e3b26ca666
sys_audio_C870.c Initial work (#135)
* func_8000BFE8

* func_8000BF6C

* func_8000BFD8

* func_8000BF94

* func_8000BFA8

* func_8000E1C4

* func_8000DBE4

* func_8000C0C0

* func_8000C1F8

* func_8000C13C

* matching

* various fixes

* AudioHeap_SearchRegularCaches

* func_8000CAF4

* func_8000DC84

* func_8000DC84

* .

* sf64 audio provisional header

* .
2024-02-18 12:43:21 -03:00

29 lines
661 B
C

#ifndef ALIGNMENT_H
#define ALIGNMENT_H
#define ALIGN8(val) (((val) + 7) & ~7)
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
#define ALIGN32(val) (((val) + 0x1F) & ~0x1F)
#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
#define ALIGN256(val) (((val) + 0xFF) & ~0xFF)
#ifdef __GNUC__
#define ALIGNED8 __attribute__ ((aligned (8)))
#else
#define ALIGNED8
#endif
#ifdef __sgi /* IDO compiler */
#define ALIGNOF(x) __builtin_alignof(x)
#elif (__STDC_VERSION__ >= 201112L) /* C11 */
#define ALIGNOF(x) _Alignof(x)
#else /* __GNUC__ */
#define ALIGNOF(x) __alignof__(x)
#endif
#define ALIGN_MASK(n) (~((n) - 1))
#define ALIGNOF_MASK(x) ALIGN_MASK(ALIGNOF(x))
#endif