Newer
Older
c-interpreter / modules / libkcpp / include / kcpp.hpp
////////////////////////////////////////////////////////////////////////////////
//
// KCPP Header File
//
#ifndef KCPP_HPP
#define KCPP_HPP


#if defined(__cplusplus) && (__cplusplus >= 201703L)
// =============================================================================
//  C++17
// =============================================================================
#include <cstdint>


#else
// =============================================================================
//  ERROR
// =============================================================================
#error "suuports C++17 or later"


#endif	// C++17, ERROR



// =============================================================================
//  Windows 判定 & 基本設定
// =============================================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__) \
 || defined(WIN64) || defined(_WIN64) || defined(__WIN64) || defined(__WIN64__)
#define KCPP_IS_WINDOWS (1)

// Windows の場合、よく利用するヘッダのインクルードや必要な設定を実施する。

// DMC にて winsock2.h を使用する場合, _WINSOCKAPI_ が必要
// 詳細は、下記URL参照
// http://www.digitalmars.com/d/archives/c++/idde/326.html
#ifdef __DMC__
#define _WINSOCKAPI_
#include <sys/types.h>
#endif

// サポートする OS バージョン指定として、Windows 10 以降を指定する
// 参考までに他バージョンの値は次の通り。
// Windows 2000         0x0500
// Windows XP           0x0501
// Windows Server 2003  0x0502
// Windows Server 2008  0x0600
// Windows 7            0x0601
// Windows 8            0x0602
// Windows 10           0x0A00
#ifndef WINVER
#define WINVER 0x0A00
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0A00
#endif

// 必要なヘッダーをインクルードする
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#ifdef _MSV_VER
#pragma comment(lib, "ws2_32.lib")
#endif

#else
#define KCPP_IS_WINDOWS (0)

#endif

#endif	// KCPP_HPP