2015-03-03 00:38:33 +08:00
|
|
|
/****************************************************************************
|
|
|
|
** GeomIO Library
|
|
|
|
** Copyright FougSys (2 Mar. 2015)
|
|
|
|
** contact@fougsys.fr
|
|
|
|
**
|
|
|
|
** This software is a reusable library whose purpose is to provide complete
|
|
|
|
** I/O support for various CAD file formats (eg. STL)
|
|
|
|
**
|
|
|
|
** This software is governed by the CeCILL-B license under French law and
|
|
|
|
** abiding by the rules of distribution of free software. You can use,
|
|
|
|
** modify and/ or redistribute the software under the terms of the CeCILL-B
|
|
|
|
** license as circulated by CEA, CNRS and INRIA at the following URL
|
|
|
|
** "http://www.cecill.info".
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#ifndef GMIO_GLOBAL_H
|
|
|
|
#define GMIO_GLOBAL_H
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-01-25 22:37:06 +08:00
|
|
|
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) \
|
2015-03-03 18:35:15 +08:00
|
|
|
|| defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
|
|
|
|
|| defined(__NT__)
|
2015-03-03 17:38:49 +08:00
|
|
|
# define GMIO_DECL_EXPORT __declspec(dllexport)
|
|
|
|
# define GMIO_DECL_IMPORT __declspec(dllimport)
|
2013-01-11 01:48:46 +08:00
|
|
|
#else
|
2015-03-03 17:38:49 +08:00
|
|
|
# define GMIO_DECL_EXPORT
|
|
|
|
# define GMIO_DECL_IMPORT
|
2013-01-11 01:48:46 +08:00
|
|
|
#endif /* WIN */
|
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#ifdef GMIO_LIB_DLL
|
2015-03-03 17:38:49 +08:00
|
|
|
# ifdef GMIO_LIB_MAKE_DLL
|
|
|
|
# define GMIO_LIB_EXPORT GMIO_DECL_EXPORT
|
|
|
|
# else
|
|
|
|
# define GMIO_LIB_EXPORT GMIO_DECL_IMPORT
|
|
|
|
# endif /* GMIO_LIB_MAKE_DLL */
|
2013-01-15 23:45:01 +08:00
|
|
|
#else
|
2015-03-03 17:38:49 +08:00
|
|
|
# define GMIO_LIB_EXPORT
|
2014-03-28 23:33:35 +08:00
|
|
|
#endif /* GMIO_LIB_DLL */
|
2013-01-15 23:45:01 +08:00
|
|
|
|
2015-03-03 18:35:15 +08:00
|
|
|
/* "config.h" is generated by cmake, it should reside in the out-of-source
|
|
|
|
* build dir.
|
|
|
|
* In CMakeFiles.txt, the directory where resides "config.h" is added to the
|
|
|
|
* include path list
|
2014-01-29 02:06:24 +08:00
|
|
|
*/
|
|
|
|
#include "config.h"
|
2013-02-21 21:37:42 +08:00
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#ifdef GMIO_HAVE_STDINT_H
|
2015-03-03 17:38:49 +08:00
|
|
|
# include <stdint.h>
|
2013-01-15 02:30:42 +08:00
|
|
|
#else
|
2014-01-21 17:49:24 +08:00
|
|
|
typedef char int8_t;
|
2013-01-15 02:30:42 +08:00
|
|
|
typedef unsigned char uint8_t;
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2014-01-21 17:49:24 +08:00
|
|
|
typedef short int16_t;
|
2013-01-15 02:30:42 +08:00
|
|
|
typedef unsigned short uint16_t;
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2014-01-21 17:49:24 +08:00
|
|
|
typedef int int32_t;
|
2013-01-15 02:30:42 +08:00
|
|
|
typedef unsigned int uint32_t;
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2013-01-25 01:38:43 +08:00
|
|
|
/*# ifdef _MSC_VER
|
2013-01-15 02:30:42 +08:00
|
|
|
typedef __int64 int64_t;
|
|
|
|
typedef unsigned __int64 uint64_t;
|
|
|
|
# else
|
|
|
|
typedef long long int64_t;
|
|
|
|
typedef unsigned long long uint64_t;
|
2013-01-25 01:38:43 +08:00
|
|
|
# endif*/ /* _MSC_VER */
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#endif /* GMIO_USE_STDINT_H */
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2014-11-11 01:31:44 +08:00
|
|
|
#ifdef GMIO_HAVE_STDBOOL_H
|
2015-03-03 17:38:49 +08:00
|
|
|
# include <stdbool.h>
|
2014-11-11 01:31:44 +08:00
|
|
|
|
|
|
|
/*! Typedef for boolean type */
|
|
|
|
typedef bool gmio_bool_t;
|
|
|
|
|
2015-03-03 17:38:49 +08:00
|
|
|
# define GMIO_FALSE false
|
|
|
|
# define GMIO_TRUE true
|
2014-11-11 01:31:44 +08:00
|
|
|
|
|
|
|
#else
|
2014-02-13 18:18:46 +08:00
|
|
|
/*! Typedef for boolean type */
|
2014-03-28 23:33:35 +08:00
|
|
|
typedef int gmio_bool_t;
|
2014-02-13 23:25:37 +08:00
|
|
|
|
2014-02-13 18:18:46 +08:00
|
|
|
/*! This enum defines true/false boolean values */
|
2014-03-28 23:33:35 +08:00
|
|
|
enum gmio_bool_value
|
2014-01-30 17:19:22 +08:00
|
|
|
{
|
2015-03-03 17:35:36 +08:00
|
|
|
GMIO_FALSE = 0,
|
|
|
|
GMIO_TRUE = 1
|
2014-01-30 17:19:22 +08:00
|
|
|
};
|
2013-01-11 01:48:46 +08:00
|
|
|
|
2014-11-11 01:31:44 +08:00
|
|
|
#endif /* GMIO_HAVE_STDBOOL_H */
|
|
|
|
|
2014-02-13 18:18:46 +08:00
|
|
|
/*! Typedef for 32bit real type (float) */
|
2015-03-03 17:44:45 +08:00
|
|
|
typedef float gmio_float32_t;
|
2014-02-13 23:25:37 +08:00
|
|
|
|
2014-02-13 18:18:46 +08:00
|
|
|
/*! Typedef for 64bit real type (double) */
|
2015-03-03 17:44:45 +08:00
|
|
|
typedef double gmio_float64_t;
|
2014-02-13 18:18:46 +08:00
|
|
|
|
2014-11-21 18:40:49 +08:00
|
|
|
/*! Tells the compiler that a parameter is not used in the body of a function */
|
|
|
|
#define GMIO_UNUSED(x) (void)x;
|
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#ifndef GMIO_INLINE
|
2015-03-03 17:38:49 +08:00
|
|
|
# if defined(__GNUC__)
|
|
|
|
# define GMIO_INLINE __inline__ /* Compatible with C90 */
|
|
|
|
# elif defined(_MSC_VER)
|
|
|
|
# define GMIO_INLINE __inline
|
|
|
|
# else
|
|
|
|
# define GMIO_INLINE
|
|
|
|
# endif
|
2014-03-28 23:33:35 +08:00
|
|
|
#endif /* !GMIO_INLINE */
|
2014-01-29 02:06:24 +08:00
|
|
|
|
2014-03-13 22:57:04 +08:00
|
|
|
#ifdef __cplusplus
|
2015-03-03 17:38:49 +08:00
|
|
|
# define GMIO_C_LINKAGE_BEGIN extern "C" {
|
|
|
|
# define GMIO_C_LINKAGE_END }
|
2014-03-13 22:57:04 +08:00
|
|
|
#else
|
2015-03-03 17:38:49 +08:00
|
|
|
# define GMIO_C_LINKAGE_BEGIN
|
|
|
|
# define GMIO_C_LINKAGE_END
|
2014-03-13 22:57:04 +08:00
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#endif /* GMIO_GLOBAL_H */
|