Main Page   Class Hierarchy   Alphabetical List   Compound List   Examples  

libconfig.h

00001 /***************************************************************************
00002     copyright            : (C) by 2002-2004 Stefano Barbato
00003     email                : stefano@codesink.org
00004 
00005     $Id: libconfig.h,v 1.7 2005/02/23 10:26:14 tat Exp $
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef _MIMETIC_LIB_CONFIG_H_
00017 #define _MIMETIC_LIB_CONFIG_H_
00018 #if defined(__unix__) || defined(__linux__) || defined(__unix) || defined(_AIX)
00019 #include "config.h"
00020 #define CONFIG_UNIX
00021 #endif
00022 
00023 /* Mac OS X */
00024 #if defined(__APPLE__) && defined(__MACH__)
00025 #include "config.h"
00026 #define CONFIG_UNIX
00027 #endif
00028 
00029 /* Windows */
00030 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
00031 #include <mimetic/config_win32.h>
00032 #include <process.h>
00033 #include <io.h>
00034 #include <ctime>
00035 #include <cstdio>
00036 typedef unsigned int uint;
00037 #define CONFIG_WIN32
00038 #endif
00039 
00040 #if !defined(CONFIG_WIN32) && !defined(CONFIG_UNIX)
00041 #error "I'm unable to guess platform type. please define CONFIG_WIN32 or CONFIG_UNIX"
00042 #endif
00043 #if defined(CONFIG_WIN32) && defined(CONFIG_UNIX)
00044 #error "I'm unable to guess platform type. please define CONFIG_UNIX or CONFIG_WIN32"
00045 #endif
00046 
00047 #ifdef CONFIG_UNIX
00048 #define PATH_SEPARATOR '/'
00049 typedef unsigned int uint32;
00050 struct newline_traits
00051 {
00052     enum { lf = 0xA, cr = 0xD };
00053     enum { size = 1 };
00054     enum { ch0 = lf, ch1 = 0 };
00055 };
00056 #endif
00057 
00058 #ifdef CONFIG_WIN32
00059 #define PATH_SEPARATOR '\\'
00060 typedef unsigned int uint32;
00061 struct newline_traits
00062 {
00063     enum { lf = 0xA, cr = 0xD };
00064     enum { size = 2 };
00065     enum { ch0 = cr, ch1 = lf };
00066 };
00067 #endif
00068 
00069 #endif