gcc(cygwin)でDirectX 10を使って(?)みた
そしてこのコードをコンパイル
#include
includeしただけなのに大量にあふれ出るエラー。よく見て分類すると以下の2種類
D3D10.h:1695: error: `__out' has not been declared
D3D10.h:1004: error: `UINT8' does not name a type
前者はMSがVC2005か何かで独自に拡張した仕様で、変数の性質を表現した言葉で、プログラム的な意味合いはないらしい。UINT8は… どこで定義してるんだろう? どうせunsignedな8bit整数だろう。
そこでソースコードの頭に以下のコードをちょっと書き込む
#define __out /**/
#define __in /**/
#define __inout /**/#define __in_opt /**/
#define __out_opt /**/
#define __inout_opt /**/#define __in_ecount(THING) /**/
#define __in_ecount_opt(THING) /**/
#define __out_ecount(THING) /**/
#define __out_ecount_opt(THING) /**/
#define __inout_ecount(THING) /**/
#define __inout_ecount_opt(THING) /**/#define __in_bcount_opt(THING) /**/
#define __out_bcount_opt(THING) /**/
#define __inout_bcount_opt(THING) /**/typedef unsigned char UINT8;
すると、先ほどのincludeするだけのコードがコンパイルに通る。
…なんでチュートリアルの1段階目のさらにその前段階でこんな手間がいるんだろう