Add workaround for old gcc and clang versions

Old gcc and clang do not handle constructor arguments, finally fix #875 as discussed there, using the fedora patch
This commit is contained in:
Martin Kroeker 2018-03-29 11:56:56 +02:00 committed by GitHub
parent 0ab5bf1746
commit 752fdb5dd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -148,8 +148,15 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define CONSTRUCTOR __attribute__ ((constructor)) #define CONSTRUCTOR __attribute__ ((constructor))
#define DESTRUCTOR __attribute__ ((destructor)) #define DESTRUCTOR __attribute__ ((destructor))
#else #else
#if __GNUC__ && INIT_PRIORITY && ((GCC_VERSION >= 40300) || (CLANG_VERSION >= 20900))
#define CONSTRUCTOR __attribute__ ((constructor(101))) #define CONSTRUCTOR __attribute__ ((constructor(101)))
#define DESTRUCTOR __attribute__ ((destructor(101))) #define DESTRUCTOR __attribute__ ((destructor(101)))
#elif __GNUC__ && INIT_PRIORITY
#define CONSTRUCTOR __attribute__ ((constructor))
#define DESTRUCTOR __attribute__ ((destructor))
#else
#define CONSTRUCTOR
#define DESTRUCTOR
#endif #endif
#ifdef DYNAMIC_ARCH #ifdef DYNAMIC_ARCH