汎用ヘッダファイルの作成

頻繁に使用するものをまとめてヘッダファイルを定義しておくと便利です。
このWEBサイトにある一部のソースは、このtypes.hとchlibs.hを使用しています。

types.hの作成

Classes/chlibs/types.h
#ifndef _CHIME_TYPES_
#define _CHIME_TYPES_
 
#ifndef lengthof
    #define lengthof(a) (sizeof(a) / sizeof((a)[0]))
#endif
 
#ifdef __i386__
    #define SIMULATOR
#else
    #define DEVICE
#endif
 
#ifndef s08
    typedef char            s08 ;
#endif
#ifndef u08
    typedef unsigned char   u08 ;
#endif
#ifndef s16
    typedef short           s16 ;
#endif
#ifndef u16
    typedef unsigned short  u16 ;
#endif
#ifndef s32
    typedef int             s32 ;
#endif
#ifndef u32
    typedef unsigned int    u32 ;
#endif
 
#endif // _CHIME_TYPES_

chlibs.hの作成

Classes/chlibs/chlibs.h
//*****************************************************************************
//!     ChLibs
/*!
//      @file
*/
//*****************************************************************************
// iPhone SDK
#import <UIKit/UIKit.h>
// 型宣言
#import "types.h"
// stl
#import <deque>
#import <list>
#import <map>
#import <string>
#import <vector>
#import <fstream>
using namespace std ;
iphone/汎用ヘッダファイルの作成.txt · 最終更新: 2018/03/18 09:56 (外部編集)
 
特に明示されていない限り、本Wikiの内容は次のライセンスに従います: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki