gmio_core: layout code with brief /* */ comments
This commit is contained in:
parent
978770c161
commit
108acf2ccd
@ -14,7 +14,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*! \file global.h
|
||||
* Fundamental global declarations, included by almost all other header files
|
||||
* Fundamental global declarations, included by almost all other header/source
|
||||
* files
|
||||
*
|
||||
* \defgroup gmio_core gmioCore
|
||||
* All other gmio modules rely on this module
|
||||
@ -26,20 +27,25 @@
|
||||
#ifndef GMIO_GLOBAL_H
|
||||
#define GMIO_GLOBAL_H
|
||||
|
||||
/* GMIO_OS_WIN */
|
||||
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) \
|
||||
|| defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
|
||||
|| defined(__NT__)
|
||||
# define GMIO_OS_WIN
|
||||
#endif /* Windows */
|
||||
#endif
|
||||
|
||||
/* GMIO_OS_LINUX */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define GMIO_OS_LINUX
|
||||
#endif /* Linux */
|
||||
#endif
|
||||
|
||||
/* GMIO_OS_MAC */
|
||||
#if defined(__APPLE__)
|
||||
# define GMIO_OS_MAC
|
||||
#endif /* Apple */
|
||||
#endif
|
||||
|
||||
/* GMIO_DECL_IMPORT */
|
||||
/* GMIO_DECL_EXPORT */
|
||||
#ifdef GMIO_OS_WIN
|
||||
# define GMIO_DECL_EXPORT __declspec(dllexport)
|
||||
# define GMIO_DECL_IMPORT __declspec(dllimport)
|
||||
@ -48,8 +54,9 @@
|
||||
# define GMIO_DECL_EXPORT
|
||||
/*! Expands to the C compiler extension to import functions from a DLL */
|
||||
# define GMIO_DECL_IMPORT
|
||||
#endif /* WIN */
|
||||
#endif
|
||||
|
||||
/* GMIO_LIB_EXPORT */
|
||||
#ifdef GMIO_LIB_DLL
|
||||
# ifdef GMIO_LIB_MAKE_DLL
|
||||
# define GMIO_LIB_EXPORT GMIO_DECL_EXPORT
|
||||
@ -60,7 +67,7 @@
|
||||
/*! Expands either to GMIO_DECL_EXPORT or GMIO_DECL_IMPORT when respectively
|
||||
* compiling/using the DLL */
|
||||
# define GMIO_LIB_EXPORT
|
||||
#endif /* GMIO_LIB_DLL */
|
||||
#endif
|
||||
|
||||
/* "config.h" is generated by cmake, it should reside in the out-of-source
|
||||
* build dir.
|
||||
@ -69,6 +76,7 @@
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
/* Typedefs for specific width integers */
|
||||
#ifdef GMIO_HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#else
|
||||
@ -82,8 +90,10 @@ typedef unsigned short uint16_t;
|
||||
/* TODO: int is not necessarily 32b on all archs */
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#endif /* GMIO_USE_STDINT_H */
|
||||
#endif
|
||||
|
||||
/* int64_t */
|
||||
/* uint64_t */
|
||||
#ifndef GMIO_HAVE_INT64_T
|
||||
# if defined(GMIO_HAVE_MSVC_INT64)
|
||||
typedef __int64_t int64_t;
|
||||
@ -92,14 +102,17 @@ typedef unsigned __int64_t uint64_t;
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
# endif
|
||||
#endif /* !GMIO_HAVE_INT64_T */
|
||||
#endif
|
||||
|
||||
/* GMIO_HAVE_INT64_TYPE */
|
||||
#if defined(GMIO_HAVE_INT64_T) \
|
||||
|| defined(GMIO_HAVE_MSVC_INT64) \
|
||||
|| defined(GMIO_HAVE_LONG_LONG)
|
||||
# define GMIO_HAVE_INT64_TYPE
|
||||
#endif
|
||||
|
||||
/* gmio_bool_t */
|
||||
/* GMIO_TRUE and GMIO_FALSE */
|
||||
#ifdef GMIO_HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
|
||||
@ -130,15 +143,18 @@ enum gmio_bool_value
|
||||
typedef int_or_bool gmio_bool_t;
|
||||
#endif /* GMIO_HAVE_STDBOOL_H */
|
||||
|
||||
/* Float types */
|
||||
/*! Typedef for 32bit real type (float) */
|
||||
typedef float gmio_float32_t;
|
||||
|
||||
/*! Typedef for 64bit real type (double) */
|
||||
typedef double gmio_float64_t;
|
||||
|
||||
/* GMIO_UNUSED */
|
||||
/*! Tells the compiler that a parameter is not used in the body of a function */
|
||||
#define GMIO_UNUSED(x) (void)x;
|
||||
|
||||
/* GMIO_INLINE */
|
||||
#ifndef GMIO_INLINE
|
||||
# if defined(__GNUC__)
|
||||
# define GMIO_INLINE __inline__ static /* Compatible with C90 */
|
||||
@ -150,8 +166,9 @@ typedef double gmio_float64_t;
|
||||
/*! Expands to the C compiler specific inline keyword (if any) */
|
||||
# define GMIO_INLINE
|
||||
# endif
|
||||
#endif /* !GMIO_INLINE */
|
||||
#endif
|
||||
|
||||
/* GMIO_RESTRICT */
|
||||
#ifndef GMIO_RESTRICT
|
||||
# if defined(__GNUC__)
|
||||
# define GMIO_RESTRICT __restrict__ /* Compatible with C90 */
|
||||
@ -163,8 +180,10 @@ typedef double gmio_float64_t;
|
||||
/*! Expands to the C compiler specific restrict keyword (if any) */
|
||||
# define GMIO_RESTRICT
|
||||
# endif
|
||||
#endif /* !GMIO_RESTRICT */
|
||||
#endif
|
||||
|
||||
/* GMIO_C_LINKAGE_BEGIN */
|
||||
/* GMIO_C_LINKAGE_END */
|
||||
#ifdef __cplusplus
|
||||
# define GMIO_C_LINKAGE_BEGIN extern "C" {
|
||||
# define GMIO_C_LINKAGE_END }
|
||||
@ -173,8 +192,10 @@ typedef double gmio_float64_t;
|
||||
# define GMIO_C_LINKAGE_BEGIN
|
||||
/*! Expands to \c } when building with a C++ compiler */
|
||||
# define GMIO_C_LINKAGE_END
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
/* GMIO_PRAGMA_MSVC_WARNING_PUSH_AND_DISABLE */
|
||||
/* GMIO_PRAGMA_MSVC_WARNING_POP */
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual C++ 2008 */
|
||||
# define GMIO_PRAGMA_MSVC_WARNING_PUSH_AND_DISABLE(__code__) \
|
||||
__pragma(warning(push)) \
|
||||
|
Loading…
Reference in New Issue
Block a user