aliceml_config.h

説明を見る。
00001 /*
00002  * Copyright (c) 2005-2007  cielacanth <cielacanth AT s60.xrea.com>
00003  * All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *    1. Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *    2. Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  * 
00014  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00015  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00017  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00018  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00019  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00020  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00021  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00022  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00023  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00024  * SUCH DAMAGE.
00025  */
00026 
00027 #ifndef __ALICEML_CONFIG_H__
00028 #define __ALICEML_CONFIG_H__
00029 
00030 #if HAVE_CONFIG_H
00031 #include "config.h"
00032 #elif defined(_WIN32) || defined(WIN32)
00033 #include "config-win32.h"
00034 #else
00035 #error Create and include a config file !
00036 #endif
00037 
00038 #if HAVE_STDBOOL_H
00039 #include <stdbool.h>
00040 #endif
00041 
00042 #if HAVE_STDINT_H
00043 #include <stdint.h>
00044 #endif
00045 
00046 #if HAVE_STDTYPES_H
00047 #include <stdtypes.h>
00048 #endif
00049 
00050 #if HAVE_STDDEF_H
00051 #include <stddef.h>
00052 #endif
00053 
00054 #if HAVE_WCHAR_H
00055 #include <wchar.h>
00056 #endif
00057 
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif
00061 
00062 /* エクスポートキーワードを追加します。*/
00063 #ifndef ALICEMLAPI
00064 #ifdef __BEOS__
00065     #if defined(__GNUC__)
00066         #define ALICEMLAPI  extern __declspec(dllexport)
00067     #else
00068         #define ALICEMLAPI  extern __declspec(export)
00069     #endif
00070 #elif WIN32
00071     #ifdef __BORLANDC__
00072         #ifdef BUILD_ALICEML
00073             #define ALICEMLAPI extern
00074         #else
00075             #define ALICEMLAPI extern __declspec(dllimport)
00076         #endif
00077     #else
00078         #define ALICEMLAPI  extern __declspec(dllexport)
00079     #endif
00080 #else
00081     #define ALICEMLAPI extern
00082 #endif
00083 #endif /* ALICEMLAPI */
00084 
00085 /* デフォルトでは一般的なC関数の呼び出し規約を使います。*/
00086 #ifndef ALICEMLCALL
00087 #if defined(WIN32) || defined(_WIN32)
00088     #define ALICEMLCALL __cdecl
00089 #else
00090     #define ALICEMLCALL
00091 #endif
00092 #endif /* ALICEMLCALL */
00093 
00094 /* コンパイラ特有のinline キーワードを定義します。*/
00095 #ifdef __GNUC__
00096     #define ALICEMLINLINE static __inline__
00097 #else
00098     /* Add any special compiler-specific cases here */
00099     #if defined(_MSC_VER) || defined(__BORLANDC__) || \
00100         defined(__DMC__) || defined(__SC__) || \
00101         defined(__WATCOMC__) || defined(__LCC__) || \
00102         defined(__DECC)
00103         #ifndef ALICEMLINLINE
00104             #define ALICEMLINLINE __inline
00105         #endif
00106     #else
00107         #if !defined(__MRC__) && !defined(_SGI_SOURCE)
00108             #define ALICEMLINLINE inline
00109         #else
00110             #ifndef ALICEMLINLINE
00111                 #define ALICEMLINLINE static
00112             #endif
00113         #endif
00114     #endif /* Visual C++ */
00115 #endif /* GNU C */
00116 
00117 /* 環境固有タイマーの処理を決定します。*/
00118 #if WIN32
00119 
00120     #define ML_USE_WIN32_TIMER 1
00121 #else
00122 
00123     #define ML_USE_POSIX_TIMER 1
00124 #endif
00125 
00126 /* 環境固有フォントファイルの位置取得処理を決定します。*/
00127 #if WIN32
00128 
00129     #define ML_USE_WIN32_FONT 1
00130 #else
00131 
00132     #define ML_USE_POSIX_FONT 1
00133 #endif
00134 
00135 /*  これをやるとライブラリ側と実行ファイル側で
00136  * __cplusplucの定義が違ったときに
00137  * プログラムの挙動がおかしなことになります。
00138  */
00139 #if 0 && defined(__cplusplus)
00140 typedef bool ML_bool;
00141 #define ML_TRUE true
00142 #define ML_FALSE false
00143 #endif
00144 
00146 typedef enum ML_bool {
00147     ML_FALSE = 0,
00148     ML_TRUE = 1,
00149 } ML_bool;
00150 
00156 #ifndef ML_CHECKUP_ASSERT
00157 #ifndef NDEBUG
00158     #define ML_CHECKUP_ASSERT 1
00159 #endif /* NDEBUG */
00160 #endif /* ML_CHECKUP_ASSERT */
00161 
00162 /* SDL がintXX_t の定義を持つ場合があります。*/
00163 #if HAVE_STDINT_H || HAVE_INTTYPES_H
00164 typedef int8_t      ML_int8;
00165 typedef int16_t     ML_int16;
00166 typedef int32_t     ML_int32;
00167 typedef int64_t     ML_int64;
00168 typedef uint8_t     ML_uint8;
00169 typedef uint16_t    ML_uint16;
00170 typedef uint32_t    ML_uint32;
00171 typedef uint64_t    ML_uint64;
00172 typedef intptr_t    ML_intptr;
00173 #endif
00174 
00175 #if defined(WCHAR_MAX)
00176     #if WCHAR_MAX > 0xffff
00177         #define ML_WCHAR_SIZE 4
00178     #else
00179         #define ML_WCHAR_SIZE 2
00180     #endif
00181 #else
00182     /* By default.*/
00183     #define ML_WCHAR_SIZE 2
00184 #endif
00185 
00186 typedef char ML_char; 
00187 typedef char ML_char8; 
00188 typedef wchar_t ML_wchar; 
00190 #if ML_WCHAR_SIZE == 4
00191     typedef ML_char16 ML_char16;
00192     typedef wchar_t ML_char32;
00193 #else
00194     typedef wchar_t ML_char16;
00195     typedef ML_uint32 ML_char32;
00196 #endif
00197 
00199 typedef size_t ML_size;
00200 
00201 #ifdef __cplusplus
00202 }
00203 #endif
00204 
00205 #endif

AliceMLに対してSat Apr 21 13:06:20 2007に生成されました。  doxygen 1.4.7