mpg123: Import upstream release 1.32.2.
[wine.git] / libs / mpg123 / src / libmpg123 / abi_align.h
blob7e5117b92ed8e96bb9431d303a814beeb82ab909
1 /*
2 abi_align: ABI and alignment stuff for library builds.
4 Original use was the definitions for avoiding breakage because of mixing
5 compilers with different alignment. Then, the switchery for building
6 DLLs got lumped in.
8 copyright 1995-2023 by the mpg123 project
9 free software under the terms of the LGPL 2.1
10 see COPYING and AUTHORS files in distribution or http://mpg123.org
12 There used to be code that checks alignment, but it did not really
13 work anyway. The only straw we have is putting that alignment
14 attribute to API functions.
17 #ifndef MPG123_H_ABI_ALIGN
18 #define MPG123_H_ABI_ALIGN
20 #include "config.h"
22 // Building any of our libs on/for Windows needs this before
23 // including the main API header (define MPG123_EXPORT).
24 #if defined(WIN32) && defined(DYNAMIC_BUILD)
25 #define BUILD_MPG123_DLL
26 #endif
28 /* ABI conformance for other compilers.
29 mpg123 needs 16byte-aligned (or more) stack for SSE and friends.
30 gcc provides that, but others don't necessarily. */
31 #ifdef ABI_ALIGN_FUN
33 #ifndef attribute_align_arg
35 #if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
36 # define attribute_align_arg __attribute__((force_align_arg_pointer))
37 /* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */
38 #else
39 # define attribute_align_arg
40 #endif
42 #endif /* attribute_align_arg */
44 #else /* ABI_ALIGN_FUN */
46 #define attribute_align_arg
48 #endif /* ABI_ALIGN_FUN */
50 #endif /* MPG123_H_ABI_ALIGN */