diff --git a/qse/include/qse/macros.h b/qse/include/qse/macros.h index 338d9947..fe93dd15 100644 --- a/qse/include/qse/macros.h +++ b/qse/include/qse/macros.h @@ -37,23 +37,6 @@ * This file contains various useful macro definitions. */ -/* ========================================================================= - * STATIC ASSERTION - * =========================================================================*/ -#define QSE_STATIC_JOIN_INNER(x, y) x ## y -#define QSE_STATIC_JOIN(x, y) QSE_STATIC_JOIN_INNER(x, y) - -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) -# define QSE_STATIC_ASSERT(expr) _Static_assert (expr, "invalid assertion") -#elif defined(__cplusplus) && (__cplusplus >= 201103L) -# define QSE_STATIC_ASSERT(expr) static_assert (expr, "invalid assertion") -#else -# define QSE_STATIC_ASSERT(expr) typedef char QSE_STATIC_JOIN(QSE_STATIC_ASSERT_T_, __LINE__)[(expr)? 1: -1] QSE_UNUSED -#endif - -#define QSE_STATIC_ASSERT_EXPR(expr) ((void)QSE_SIZEOF(char[(expr)? 1: -1])) - - #if defined(__cplusplus) || (defined(__STDC_VERSION__) && (__STDC_VERSION__>=199901L)) # define QSE_INLINE inline # define QSE_HAVE_INLINE @@ -89,14 +72,6 @@ # undef QSE_HAVE_INLINE_NEVER #endif - -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) -# define QSE_UNUSED __attribute__((__unused__)) -#else -# define QSE_UNUSED -#endif - - #if defined(_WIN32) || (defined(__WATCOMC__) && !defined(__WINDOWS_386__)) # define QSE_IMPORT __declspec(dllimport) # define QSE_EXPORT __declspec(dllexport) diff --git a/qse/include/qse/types.h b/qse/include/qse/types.h index d37b8ef1..79bad89e 100644 --- a/qse/include/qse/types.h +++ b/qse/include/qse/types.h @@ -70,6 +70,32 @@ # endif #endif +/* ========================================================================= + * STATIC ASSERTION + * =========================================================================*/ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) +# define QSE_UNUSED __attribute__((__unused__)) +#else +# define QSE_UNUSED +#endif + +#define QSE_STATIC_JOIN_INNER(x, y) x ## y +#define QSE_STATIC_JOIN(x, y) QSE_STATIC_JOIN_INNER(x, y) + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +# define QSE_STATIC_ASSERT(expr) _Static_assert (expr, "invalid assertion") +#elif defined(__cplusplus) && (__cplusplus >= 201103L) +# define QSE_STATIC_ASSERT(expr) static_assert (expr, "invalid assertion") +#else +# define QSE_STATIC_ASSERT(expr) typedef char QSE_STATIC_JOIN(QSE_STATIC_ASSERT_T_, __LINE__)[(expr)? 1: -1] QSE_UNUSED +#endif + +#define QSE_STATIC_ASSERT_EXPR(expr) ((void)QSE_SIZEOF(char[(expr)? 1: -1])) + +/* ========================================================================= + * BASIC TYPES + * =========================================================================*/ + /** * The qse_bool_t type defines a boolean type that can represent #QSE_TRUE * and #QSE_FALSE. diff --git a/qse/pkgs/qse.spec.in b/qse/pkgs/qse.spec.in index e53f7122..699f9393 100644 --- a/qse/pkgs/qse.spec.in +++ b/qse/pkgs/qse.spec.in @@ -1,4 +1,4 @@ -%define _prefix /usr/local +%define _prefix /usr %define _sysconfdir /etc Summary: QSE Library @@ -22,7 +22,7 @@ QSE Library %package devel Summary: Development files for QSE Group: System Environment/Libraries -Requires: @PACKAGE_NAME@= %{version} +Requires: @PACKAGE_NAME@ = %{version} %description devel The header files and libraries for developing applications with QSE.