Newer
Older
snipet / jpcc / trunk / modules / 00_com / osw / include / osw_stdbool.h
/**
 * @file  osw_stdbool.h
 * @brief osw stdbool ヘッダ.
 *
 * Copyright (c)  2003 - 2015  Nomura Kei
 * License : THE MIT License <http://opensource.org/licenses/mit-license.php>
 *
 * C99 以降であれば, stdbool.h を読み込む.
 * 以外であれば, stdbool.h と同等の定義を実施します.
 */
#ifndef OSW_STDBOOL_H
#define OSW_STDBOOL_H

#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
/* -----------------------------------------------------------------------------
 *  サポートしていれば, 単に stdbool.h を読み込む
 * -----------------------------------------------------------------------------
 */
#include <stdbool.h>


#else
/* -----------------------------------------------------------------------------
 *  bool を定義する
 * -----------------------------------------------------------------------------
 */
typedef enum {
	false	= 0,
	true	= 1
} bool;
#ifndef _Bool
#define _Bool bool
#endif

#endif	/*	stdbool.h		*/


#endif	/* OSW_STDBOOL_H	*/