Drizzled Public API Documentation

CSConfig.h
00001 /* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
00002  *
00003  * PrimeBase Media Stream for MySQL
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00018  *
00019  * Original author: Paul McCullagh (H&G2JCtL)
00020  * Continued development: Barry Leslie
00021  *
00022  * 2007-05-30
00023  *
00024  * CORE SYSTEM:
00025  * Compilation flags. Should be included at the top of all
00026  * source files.
00027  *
00028  */
00029 
00030 #pragma once
00031 #ifndef __CSCONFIG_H__
00032 #define __CSCONFIG_H__
00033 
00034 #if defined(MYSQL_SERVER) ||  defined(DRIZZLED)
00035 // Because mysql_priv.h can redefine system data types it is not safe to include it
00036 // in some souce code files and not others because of what it may do to structures defined
00037 // in other headers. So the only safe thing I can think of is to include it in all source code
00038 // files.
00039 #ifdef DRIZZLED
00040 #include <config.h>
00041 #include <drizzled/common.h>
00042 #else
00043 #include "my_global.h"
00044 #include "mysql_priv.h"
00045 #endif
00046 
00047 #else  // defined(MYSQL_SERVER) ||  defined(DRIZZLED)
00048 
00049 #if defined(WIN32) ||  defined(WIN64) 
00050 #include "win_config.h"
00051 #else
00052 #include <config.h>
00053 #endif
00054 
00055 #endif // defined(MYSQL_SERVER) ||  defined(DRIZZLED)
00056 
00057 
00058 /*
00059  * This enables everything that GNU can do. The macro is actually
00060  * recommended for new programs.
00061  */
00062 #ifndef _GNU_SOURCE
00063 #define _GNU_SOURCE
00064 #endif
00065 
00066 /*
00067  * Make sure we use the thread safe version of the library.
00068  */
00069 #ifndef _THREAD_SAFE // Seems to be defined by some Drizzle header
00070 #define _THREAD_SAFE
00071 #endif
00072 
00073 /*
00074  * This causes things to be defined like stuff in inttypes.h
00075  * which is used in printf()
00076  */
00077 #ifndef __STDC_FORMAT_MACROS
00078 #define __STDC_FORMAT_MACROS
00079 #endif
00080 
00081 /*
00082  * What operating system are we on?
00083  */
00084 #ifdef __APPLE__
00085 #define OS_MACINTOSH
00086 #endif
00087 
00088 #if defined(MSDOS) || defined(__WIN__) || defined(_WIN64) || defined(WIN32)
00089 #define OS_WINDOWS
00090 #endif
00091 
00092 #ifdef __FreeBSD__
00093 #define OS_FREEBSD
00094 #endif
00095 
00096 #ifdef __NetBSD__
00097 #define OS_NETBSD
00098 #endif
00099 
00100 #ifdef __sun
00101 #define OS_SOLARIS
00102 #endif
00103 
00104 #if defined(_DEBUG) || defined(DBUG_ON)
00105 #if !defined(NODEBUG) && !defined(DBUG_OFF) && !defined(DEBUG)
00106 #define DEBUG
00107 #endif
00108 #endif
00109 
00110 #endif