2010-08-08 10:06:34 +02:00
/*
Copyright ( c ) 1998 - 2010 , Enno Rehling < enno @ eressea . de >
Katja Zedel < katze @ felidae . kn - bremen . de
Christian Schlittchen < corwin @ amber . kn - bremen . de >
Permission to use , copy , modify , and / or distribute this software for any
purpose with or without fee is hereby granted , provided that the above
copyright notice and this permission notice appear in all copies .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
ACTION OF CONTRACT , NEGLIGENCE OR OTHER TORTIOUS ACTION , ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE .
* */
# ifndef CONFIG_H
# define CONFIG_H
# ifdef _MSC_VER
# define VC_EXTRALEAN
# define WIN32_LEAN_AND_MEAN
2012-05-16 00:04:23 +02:00
# include <windows.h>
2010-08-08 10:06:34 +02:00
# undef MOUSE_MOVED
2011-03-07 08:02:35 +01:00
# define STDIO_CP 1252 /* log.c, convert to console character set */
2010-08-08 10:06:34 +02:00
# pragma warning (disable: 4201 4214 4514 4115 4711)
# pragma warning(disable: 4056)
/* warning C4056: overflow in floating point constant arithmetic */
# pragma warning(disable: 4201)
/* warning C4201: nonstandard extension used : nameless struct/union */
# pragma warning(disable: 4214)
/* warning C4214: nonstandard extension used : bit field types other than int */
# pragma warning(disable: 4100)
/* warning C4100: <name> : unreferenced formal parameter */
# pragma warning(disable: 4996)
2012-05-16 00:04:23 +02:00
/* <name> is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */
# pragma warning(disable: 4668)
2010-08-08 10:06:34 +02:00
/* warning C4100: <name> was declared deprecated */
# ifndef _CRT_SECURE_NO_DEPRECATE
# define _CRT_SECURE_NO_DEPRECATE
# endif
2013-12-31 10:06:28 +01:00
/*
* http : //msdn2.microsoft.com/en-us/library/ms235505(VS.80).aspx
* Defining _CRT_DISABLE_PERFCRIT_LOCKS forces all I / O operations to assume a
* single - threaded I / O model and use the _nolock forms of the functions .
*/
2010-08-08 10:06:34 +02:00
# ifndef _CRT_DISABLE_PERFCRIT_LOCKS
# define _CRT_DISABLE_PERFCRIT_LOCKS
# endif
/* define CRTDBG to enable MSVC CRT Debug library functions */
2014-03-15 19:29:11 +01:00
# if defined(_DEBUG) && defined(CRTDBG)
2010-08-08 10:06:34 +02:00
# include <crtdbg.h>
# define _CRTDBG_MAP_ALLOC
# endif
2014-03-15 19:29:11 +01:00
# define HAVE_INLINE
# define INLINE_FUNCTION __inline
# endif /* _MSC_VER_ */
2010-08-08 10:06:34 +02:00
2014-03-15 19:29:11 +01:00
# if defined __GNUC__
# define HAVE_INLINE
# define INLINE_FUNCTION static __inline
# undef _BSD_SOURCE
# define _BSD_SOURCE
# undef __USE_BSD
# define __USE_BSD
2010-08-08 10:06:34 +02:00
# endif
# ifdef _BSD_SOURCE
2014-03-15 19:29:11 +01:00
# undef __EXTENSIONS__
2010-08-08 10:06:34 +02:00
# define __EXTENSIONS__
# endif
2014-03-15 19:29:11 +01:00
# ifdef SOLARIS
# define _SYS_PROCSET_H
# undef _XOPEN_SOURCE
# define _XOPEN_SOURCE
2010-08-08 10:06:34 +02:00
# endif
2011-02-26 10:21:10 +01:00
/* TinyCC */
# ifdef TINYCC
# undef HAVE_INLINE
2011-03-07 08:02:35 +01:00
# define INLINE_FUNCTION
2011-02-26 10:21:10 +01:00
# endif
2011-03-07 08:02:35 +01:00
2010-08-08 10:06:34 +02:00
/**** ****
* * min / max macros * *
* * * * * * * */
# ifndef NOMINMAX
# ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
# endif
# ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
# endif
# endif
2011-03-07 08:02:35 +01:00
2010-08-08 10:06:34 +02:00
# if defined (__GNUC__)
2011-03-07 08:02:35 +01:00
# define unused(a) /* unused: a */
2010-08-08 10:06:34 +02:00
# elif defined (ghs) || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__KCC) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544)
# define unused(a) do { /* null */ } while (&a == 0)
# else /* ghs || __GNUC__ || ..... */
# define unused(a) (a)
# endif /* ghs || __GNUC__ || ..... */
2012-06-24 07:08:16 +02:00
# include "util/bool.h"
2010-08-08 10:06:34 +02:00
# ifndef INLINE_FUNCTION
# define INLINE_FUNCTION
# endif
# define iswxspace(c) (c==160 || iswspace(c))
# define isxspace(c) (c==160 || isspace(c))
# define TOLUA_CAST (char*)
2013-12-29 09:31:49 +01:00
2014-03-15 19:29:11 +01:00
# ifdef USE_AUTOCONF
# include <autoconf.h>
2013-12-29 09:31:49 +01:00
# endif
2014-03-15 19:29:11 +01:00
# if !defined(MAX_PATH)
# if defined(PATH_MAX)
# define MAX_PATH PATH_MAX
2013-12-31 10:25:25 +01:00
# else
2014-03-15 19:29:11 +01:00
# define MAX_PATH 256
# endif
# endif
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
# ifdef HAVE_STRINGS_H
# include <strings.h>
2013-12-31 10:25:25 +01:00
# endif
2010-08-08 10:06:34 +02:00
# endif