#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
/**
Header for compiler-dependent features.
Intended to contain a set of reusable wrappers for preprocessor
macros, attributes, pragmas, and any other features that are
specific to a target compiler.
*/
/**
Compiler-dependent internal convenience macros.
*/
/* C vs C++ */
#ifdef __cplusplus
#define CONSTEXPR constexpr
#else
#define CONSTEXPR
#endif /* __cplusplus */
/* GNU C/C++ */
#if defined __GNUC__
# define MY_ALIGN_EXT
/*
__builtin_unreachable() removes the "statement may fall through" warning-as-
error when MY_ASSERT_UNREACHABLE() is used in "case xxx:" in switch (...)
statements.
abort() is there to prevent the execution from reaching the
__builtin_unreachable() as this may cause misleading stack traces.
*/
# define MY_ASSERT_UNREACHABLE() { abort(); __builtin_unreachable(); }
/* Microsoft Visual C++ */
#elif defined _MSC_VER
# define MY_ALIGNOF(type) __alignof(type)
# define MY_ALIGNED(n) __declspec(align(n))
/* Oracle Solaris Studio */
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if __SUNPRO_C >= 0x590
# define MY_ALIGN_EXT
# endif
/* IBM XL C/C++ */
#elif defined __xlC__
# if __xlC__ >= 0x0600
# define MY_ALIGN_EXT
# endif
/* HP aCC */
#elif defined(__HP_aCC) || defined(__HP_cc)
# if (__HP_aCC >= 60000) || (__HP_cc >= 60000)
# define MY_ALIGN_EXT
# endif
#endif
#ifdef MY_ALIGN_EXT
/** Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type) __alignof__(type)
/** Determine the alignment requirement of a type. */
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
#endif
/**
Generic (compiler-independent) features.
*/
#ifndef MY_ALIGNOF
# ifdef __cplusplus
template