Index: /trunk/Include/Classes/ActiveBasic/Strings/Strings.ab
===================================================================
--- /trunk/Include/Classes/ActiveBasic/Strings/Strings.ab	(revision 496)
+++ /trunk/Include/Classes/ActiveBasic/Strings/Strings.ab	(revision 497)
@@ -191,5 +191,5 @@
 
 Namespace Detail
-Function Split(s As String, c As StrChar) As System.Collections.Generic.List<String>
+Function Split(s As String, c As Char) As System.Collections.Generic.List<String>
 	Split = New System.Collections.Generic.List<String>
 
Index: /trunk/Include/Classes/System/Data/Odbc/Odbc.ab
===================================================================
--- /trunk/Include/Classes/System/Data/Odbc/Odbc.ab	(revision 496)
+++ /trunk/Include/Classes/System/Data/Odbc/Odbc.ab	(revision 497)
@@ -1,9 +1,5 @@
 ' odbc.sbp
 
-#ifndef _INC_SQLEXT
-#include <api_sqlext.sbp>
-#endif
-
-
+#require <api_sqlext.sbp>
 
 '===========================================================
@@ -143,5 +139,5 @@
 
 		'ステートメントハンドルを取得する
-		SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt )	
+		SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt )
 
 		'SQL文を発行
@@ -154,5 +150,5 @@
 
 		'ステートメントハンドルを取得する
-		SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt )	
+		SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt )
 
 		Prepare = SQLPrepare( hStmt, lpszSQL, SQL_NTS )	'SQL文を設定する
@@ -244,5 +240,5 @@
 		SQLAllocHandle( SQL_HANDLE_STMT,
 			pobj_Command->pobj_Connection->GetDbcHandle(),
-			hStmt )	
+			hStmt )
 
 		'SQL文を発行
Index: /trunk/Include/Classes/System/Drawing/CharacterRange.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/CharacterRange.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/CharacterRange.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/Drawing/CharacterRange.ab
-
-#ifndef __SYSTEM_DRAWING_CHARACTERRANGE_AB__
-#define __SYSTEM_DRAWING_CHARACTERRANGE_AB__
 
 Class CharacterRange
@@ -52,4 +49,2 @@
 	length As Long
 End Class
-
-#endif '__SYSTEM_DRAWING_CHARACTERRANGE_AB__
Index: /trunk/Include/Classes/System/Drawing/Color.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Color.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Color.ab	(revision 497)
@@ -1,8 +1,5 @@
 ' Classes/System/Drawing/Color.ab
 
-#ifndef __SYSTEM_DRAWING_COLOR_AB__
-#define __SYSTEM_DRAWING_COLOR_AB__
-
-#include <Classes/System/Drawing/Imaging/misc.ab>
+#require <Classes/System/Drawing/Imaging/misc.ab>
 
 Class Color
@@ -309,4 +306,2 @@
 	argb As ARGB
 End Class
-
-#endif '__SYSTEM_DRAWING_COLOR_AB__
Index: /trunk/Include/Classes/System/Drawing/Drawing2D/Matrix.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Drawing2D/Matrix.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Drawing2D/Matrix.ab	(revision 497)
@@ -1,9 +1,4 @@
 ' Classes/System/Drawing/Drawing2D/Matrix.ab
-
-#ifndef __SYSTEM_DRAWING_DRAWING2D_MATRIX_AB__
-#define __SYSTEM_DRAWING_DRAWING2D_MATRIX_AB__
 
 Class Matrix
 End Class
-
-#endif '__SYSTEM_DRAWING_DRAWING2D_MATRIX_AB__
Index: /trunk/Include/Classes/System/Drawing/Drawing2D/misc.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Drawing2D/misc.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Drawing2D/misc.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/Drawing/Drawing2D/misc.ab
-
-#ifndef __SYSTEM_DRAWING_DRAWING2D_MISC_AB__
-#define __SYSTEM_DRAWING_DRAWING2D_MISC_AB__
 
 Enum CombineMode
@@ -84,4 +81,2 @@
 	Device
 End Enum
-
-#endif '__SYSTEM_DRAWING_DRAWING2D_MISC_AB__
Index: /trunk/Include/Classes/System/Drawing/Font.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Font.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Font.ab	(revision 497)
@@ -250,10 +250,10 @@
 
 	Const Function Name() As String
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+		Dim lf As LOGFONTW
+		GetLogFontW(0, lf)
+#else
 		Dim lf As LOGFONTA
 		GetLogFontA(0, lf)
-#else
-		Dim lf As LOGFONTW
-		GetLogFontW(0, lf)
 #endif
 		Return lf.lfFaceName
Index: /trunk/Include/Classes/System/Drawing/Graphics.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Graphics.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Graphics.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/Drawing/Graphics.ab
-
-#ifndef __SYSTEM_DRAWING_GRAPHICS_AB__
-#define __SYSTEM_DRAWING_GRAPHICS_AB__
 
 Class Brush : End Class
@@ -2011,3 +2008,2 @@
 End Class
 
-#endif
Index: /trunk/Include/Classes/System/Drawing/Imaging/MetafileHeader.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Imaging/MetafileHeader.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Imaging/MetafileHeader.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/Drawing/Imaging/MetafileHeader.ab
-
-#ifndef __SYSTEM_DRAWING_IMAGING_METAFILEHEADER_AB__
-#define __SYSTEM_DRAWING_IMAGING_METAFILEHEADER_AB__
 
 Type Align(8) ENHMETAHEADER3
@@ -154,4 +151,2 @@
 	End Function
 End Class
-
-#endif '__SYSTEM_DRAWING_IMAGING_METAFILEHEADER_AB__
Index: /trunk/Include/Classes/System/Drawing/Imaging/misc.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Imaging/misc.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Imaging/misc.ab	(revision 497)
@@ -1,8 +1,5 @@
 ' Classes/System/Drawing/Imaging/misc.ab
 
-#ifndef __SYSTEM_DRAWING_IMAGING_MISC_AB__
-#define __SYSTEM_DRAWING_IMAGING_MISC_AB__
-
-#include <Classes/System/Drawing/Color.ab>
+#require <Classes/System/Drawing/Color.ab>
 
 TypeDef ARGB = DWord
@@ -436,4 +433,2 @@
 	ColorChannelLast
 End Enum
-
-#endif '__SYSTEM_DRAWING_IMAGING_MISC_AB__
Index: /trunk/Include/Classes/System/Drawing/Text/misc.ab
===================================================================
--- /trunk/Include/Classes/System/Drawing/Text/misc.ab	(revision 496)
+++ /trunk/Include/Classes/System/Drawing/Text/misc.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/Drawing/Text/misc.ab
-
-#ifndef __SYSTEM_DRAWING_TEXT_MISC_AB__
-#define __SYSTEM_DRAWING_TEXT_MISC_AB__
 
 Enum TextRenderingHint
@@ -12,4 +9,2 @@
 	ClearTypeGridFit
 End Enum
-
-#endif '__SYSTEM_DRAWING_TEXT_MISC_AB__
Index: /trunk/Include/Classes/System/Environment.ab
===================================================================
--- /trunk/Include/Classes/System/Environment.ab	(revision 496)
+++ /trunk/Include/Classes/System/Environment.ab	(revision 497)
@@ -20,8 +20,8 @@
 	Static Function CommandLine() As String
 		If Object.ReferenceEquals(cmdLine, Nothing) Then
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+			cmdLine = New String(GetCommandLineW())
+#else
 			cmdLine = New String(GetCommandLineA())
-#else
-			cmdLine = New String(GetCommandLineW())
 #endif
 		End If
@@ -120,5 +120,5 @@
 Public
 	'NTでしか使用できない仕様
-	Static Function WorkingSet() As Int64
+	Static Function WorkingSet() As SIZE_T
 		Dim hmodPSAPI = LoadLibrary("PSAPI.DLL")
 		If hmodPSAPI = 0 Then Return 0
@@ -141,9 +141,14 @@
 
 	Static Function ExpandEnvironmentVariables(s As String) As String
+		If ActiveBasic.IsNothing(s) Then
+			Throw New ArgumentNullException("s")
+		End If
 		Dim src = ToTCStr(s)
 		Dim size = ExpandEnvironmentStrings(src, 0, 0)
-		Dim dst = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
-		ExpandEnvironmentStrings(src, dst, size)
-		ExpandEnvironmentVariables = New String(dst, size - 1)
+		Dim dst = New Text.StringBuilder
+		dst.Length = size As Long
+		ExpandEnvironmentStrings(src, StrPtr(dst), size)
+		dst.Length = (size - 1) As Long
+		ExpandEnvironmentVariables = dst.ToString
 	End Function
 
@@ -155,9 +160,13 @@
 
 	Static Function GetEnvironmentVariable(variable As String) As String
+		If ActiveBasic.IsNothing(variable) Then
+			Throw New ArgumentNullException("variable")
+		End If
 		Dim tcsVariable = ToTCStr(variable)
 		Dim size = _System_GetEnvironmentVariable(tcsVariable, 0, 0)
-		Dim p = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
-		Dim len = _System_GetEnvironmentVariable(tcsVariable, p, size)
-		GetEnvironmentVariable = New String(p, len As Long)
+		Dim buf = New Text.StringBuilder
+		buf.Length = size As Long
+		buf.Length  = _System_GetEnvironmentVariable(tcsVariable, StrPtr(buf), size)
+		GetEnvironmentVariable = buf.ToString
 	End Function
 
@@ -176,4 +185,7 @@
 
 	Static Sub SetEnvironmentVariable(variable As String, value As String)
+		If ActiveBasic.IsNothing(variable) Then
+			Throw New ArgumentNullException("variable")
+		End If
 		_System_SetEnvironmentVariable(ToTCStr(variable), ToTCStr(value))
 	End Sub
Index: /trunk/Include/Classes/System/IO/Path.ab
===================================================================
--- /trunk/Include/Classes/System/IO/Path.ab	(revision 496)
+++ /trunk/Include/Classes/System/IO/Path.ab	(revision 497)
@@ -10,8 +10,8 @@
 Class Path
 Public
-	Static Const AltDirectorySeparatorChar = &H2F As StrChar '/
-	Static Const DirectorySeparatorChar    = &H5C As StrChar '\
-	Static Const PathSeparator             = &H3B As StrChar ';
-	Static Const VolumeSeparatorChar       = &H3A As StrChar ':
+	Static Const AltDirectorySeparatorChar = &H2F As Char '/
+	Static Const DirectorySeparatorChar    = &H5C As Char '\
+	Static Const PathSeparator             = &H3B As Char ';
+	Static Const VolumeSeparatorChar       = &H3A As Char ':
 
 	'----------------------------------------------------------------
@@ -135,5 +135,5 @@
 		If IsPathRooted(path) Then
 			If path.Contains(UniformNamingConventionString) Then
-				Return path.Remove(path.IndexOf(DirectorySeparatorChar, 
+				Return path.Remove(path.IndexOf(DirectorySeparatorChar,
 													  UniformNamingConventionString.Length) + 1)
 			Else
@@ -214,5 +214,5 @@
 
 Private
-	Static Const ExtensionSeparatorChar = &H2E As StrChar
+	Static Const ExtensionSeparatorChar = &H2E As Char
 	Static Const InvalidPathChars = Ex"\q<>|\0\t" As String
 	Static Const UniformNamingConventionString = "\\" As String
@@ -258,5 +258,5 @@
 	*/
 	Static Function GetLastSeparatorIndex(path As String) As Long
-		Return System.Math.Max(path.LastIndexOf(DirectorySeparatorChar), 
+		Return System.Math.Max(path.LastIndexOf(DirectorySeparatorChar),
 							   path.LastIndexOf(AltDirectorySeparatorChar)) As Long
 	End Function
Index: /trunk/Include/Classes/System/IO/StreamReader.ab
===================================================================
--- /trunk/Include/Classes/System/IO/StreamReader.ab	(revision 496)
+++ /trunk/Include/Classes/System/IO/StreamReader.ab	(revision 497)
@@ -93,5 +93,5 @@
 	@auther Egtra
 	*/
-	Override Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
+	Override Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
 		Dim n = last - cur
 		If count <= n Then
@@ -143,6 +143,6 @@
 	文字数が足りなくても、元のストリームまで読みには行かない。
 	*/
-	Function ReadFromBuffer(p As *StrChar, index As Long, count As Long) As Long
-		memcpy(VarPtr(p[index]), VarPtr(buf[cur]), count * SizeOf (StrChar))
+	Function ReadFromBuffer(p As *Char, index As Long, count As Long) As Long
+		memcpy(VarPtr(p[index]), VarPtr(buf[cur]), count * SizeOf (Char))
 		cur += count
 		ReadFromBuffer = count
Index: /trunk/Include/Classes/System/IO/StringReader.ab
===================================================================
--- /trunk/Include/Classes/System/IO/StringReader.ab	(revision 496)
+++ /trunk/Include/Classes/System/IO/StringReader.ab	(revision 497)
@@ -75,7 +75,7 @@
 	@auther Egtra
 	*/
-	Override Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
+	Override Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
 		ReadImpl = Math.Min(count, s.Length - i)
-		ActiveBasic.Strings.ChrCopy(VarPtr(buffer[index]) As *StrChar, (StrPtr(s) + i * SizeOf (StrChar)) As *StrChar, ReadImpl As SIZE_T) 'ToDo: ポインタに対する+演算
+		ActiveBasic.Strings.ChrCopy(VarPtr(buffer[index]) As *Char, (StrPtr(s) + i * SizeOf (Char)) As *Char, ReadImpl As SIZE_T) 'ToDo: ポインタに対する+演算
 	End Function
 
Index: /trunk/Include/Classes/System/IO/TextReader.ab
===================================================================
--- /trunk/Include/Classes/System/IO/TextReader.ab	(revision 496)
+++ /trunk/Include/Classes/System/IO/TextReader.ab	(revision 497)
@@ -31,5 +31,5 @@
 	@auther Egtra
 	*/
-	Function Read(buffer As *StrChar, index As Long, count As Long) As Long
+	Function Read(buffer As *Char, index As Long, count As Long) As Long
 		If buffer = 0 Then
 		ElseIf index < 0 Then
@@ -76,5 +76,5 @@
 '					Exit Do
 			End Select
-			sb.Append(ch As StrChar) 'ToDo キャスト不要にすべきというチケットを書くこと
+			sb.Append(ch As Char) 'ToDo キャスト不要にすべきというチケットを書くこと
 		Loop
 		ReadLine = sb.ToString
@@ -93,5 +93,5 @@
 				Exit Function
 			End If
-			sb.Append(ch As StrChar)
+			sb.Append(ch As Char)
 		Loop
 	End Function
@@ -109,5 +109,5 @@
 	@auther Egtra
 	*/
-	Virtual Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
+	Virtual Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
 		Dim i As Long
 		Dim p = VarPtr(buffer[index])
@@ -118,5 +118,5 @@
 				Exit Function
 			Else
-				p[i] = c As StrChar
+				p[i] = c As Char
 			End If
 		Next
@@ -171,5 +171,5 @@
 	End Sub
 
-	Override Function ReadImpl(buffer As *StrChar, index As Long, count As Long) As Long
+	Override Function ReadImpl(buffer As *Char, index As Long, count As Long) As Long
 '		Using lock = cs.Lock
 			ReadImpl = base.ReadImpl(buffer, index, count)
Index: /trunk/Include/Classes/System/Math.ab
===================================================================
--- /trunk/Include/Classes/System/Math.ab	(revision 496)
+++ /trunk/Include/Classes/System/Math.ab	(revision 497)
@@ -2,7 +2,4 @@
 
 #require <Classes/ActiveBasic/Math/Math.ab>
-
-#ifndef __SYSTEM_MATH_AB__
-#define __SYSTEM_MATH_AB__
 
 Namespace System
@@ -600,4 +597,2 @@
 Const _System_InverseLn10 = 0.43429448190325182765112891891661 '1 / (ln 10)
 Const _System_InverseSqrt2 = 0.70710678118654752440084436210485 '1 / (√2)
-
-#endif '__SYSTEM_MATH_AB__
Index: /trunk/Include/Classes/System/OperatingSystem.ab
===================================================================
--- /trunk/Include/Classes/System/OperatingSystem.ab	(revision 496)
+++ /trunk/Include/Classes/System/OperatingSystem.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/OperatingSystem.ab
-
-#ifndef __SYSYTEM_OPERATINGSYSTEM_AB__
-#define __SYSYTEM_OPERATINGSYSTEM_AB__
 
 #require <Classes/System/Version.ab>
@@ -86,4 +83,2 @@
 
 End Namespace
-
-#endif '__SYSYTEM_OPERATINGSYSTEM_AB__
Index: /trunk/Include/Classes/System/String.ab
===================================================================
--- /trunk/Include/Classes/System/String.ab	(revision 496)
+++ /trunk/Include/Classes/System/String.ab	(revision 497)
@@ -1,15 +1,3 @@
 ' Classes/System/String.ab
-
-#require <basic/function.sbp>
-#require <Classes/System/Text/StringBuilder.ab>
-#require <Classes/ActiveBasic/Strings/Strings.ab>
-
-TypeDef StrChar = Char
-
-#ifdef UNICODE
-#define __STRING_IS_UNICODE
-#else
-#define __STRING_IS_NOT_UNICODE
-#endif
 
 Namespace System
@@ -270,7 +258,5 @@
 
 		Sub Assign(text As PCSTR, textLengthA As Long)
-#ifdef __STRING_IS_NOT_UNICODE
-			AssignFromCharPtr(text, textLengthA)
-#else
+#ifdef UNICODE
 			Dim textLengthW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, 0, 0)
 			If AllocStringBuffer(textLengthW) <> 0 Then
@@ -278,9 +264,13 @@
 				Chars[textLengthW] = 0
 			End If
+#else
+			AssignFromCharPtr(text, textLengthA)
 #endif
 		End Sub
 
 		Sub Assign(text As PCWSTR, textLengthW As Long)
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+			AssignFromCharPtr(text, textLengthW)
+#else
 			Dim textLengthA = WideCharToMultiByte(CP_THREAD_ACP, 0, text, textLengthW, 0, 0, 0, 0)
 			If AllocStringBuffer(textLengthA) <> 0 Then
@@ -288,6 +278,4 @@
 				Chars[textLengthA] = 0
 			End If
-#else
-			AssignFromCharPtr(text, textLengthW)
 #endif
 		End Sub
@@ -305,7 +293,5 @@
 	Public
 		Const Function Concat(text As PCSTR, len As Long) As String
-#ifdef __STRING_IS_NOT_UNICODE
-			Return ConcatChar(This.Chars, m_Length, text, len)
-#else
+#ifdef UNICODE
 			With Concat
 				Dim lenW = MultiByteToWideChar(CP_THREAD_ACP, 0, text, len, 0, 0)
@@ -316,9 +302,13 @@
 				.Chars[m_Length + lenW] = 0
 			End With
+#else
+			Return ConcatChar(This.Chars, m_Length, text, len)
 #endif
 		End Function
 
 		Const Function Concat(text As PCWSTR, len As Long) As String
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+			Return ConcatChar(This.Chars, m_Length, text, len)
+#else
 			With Concat
 				Concat = New String
@@ -329,6 +319,4 @@
 				.Chars[m_Length + lenA] = 0
 			End With
-#else
-			Return ConcatChar(This.Chars, m_Length, text, len)
 #endif
 		End Function
@@ -600,8 +588,8 @@
 
 		Override Function GetHashCode() As Long
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+			Dim size = m_Length
+#else
 			Dim size = (m_Length + 1) >> 1
-#else
-			Dim size = m_Length
 #endif
 			Return _System_GetHashFromWordArray(Chars As *Word, size) Xor m_Length
Index: /trunk/Include/Classes/System/Text/DecoderFallback.ab
===================================================================
--- /trunk/Include/Classes/System/Text/DecoderFallback.ab	(revision 496)
+++ /trunk/Include/Classes/System/Text/DecoderFallback.ab	(revision 497)
@@ -77,5 +77,5 @@
 		len = length
 	End Sub
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 	/*!
 	@brief	指定された文字列でDecoderReplacementFallbackを構築する。
@@ -124,5 +124,5 @@
 	End Function
 
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 	/*!
 	@brief	代替文字列を返す
@@ -167,5 +167,5 @@
 		End If
 	End Sub
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 	/*!
 	@brief	指定された文字列でDecoderReplacementFallbackを構築する。
Index: /trunk/Include/Classes/System/Text/Encoding.ab
===================================================================
--- /trunk/Include/Classes/System/Text/Encoding.ab	(revision 496)
+++ /trunk/Include/Classes/System/Text/Encoding.ab	(revision 497)
@@ -1,4 +1,2 @@
-#define __STRING_IS_NOT_UNICODE 'なぜか認識されないので
-
 /*!
 @file	Classes/System/Text/Encoding.ab
@@ -52,5 +50,5 @@
 		Return GetBytesCountCore(s, n)
 	End Function
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 	/*!
 	@brief	符号化して得られる文字列の長さを計算する。
@@ -141,5 +139,5 @@
 		Return GetBytesCore(VarPtr(chars[index]), count, bytes, byteCount)
 	End Function
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 	/*!
 	@brief	符号化する。
@@ -289,5 +287,5 @@
 	Abstract Function GetCharsCore(bytes As *Byte, byteCount As Long, chars As *WCHAR, charCount As Long) As Long
 Public
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 	/*!
 	@brief	復号し、Stringで結果を返す。
Index: /trunk/Include/Classes/System/Text/StringBuilder.ab
===================================================================
--- /trunk/Include/Classes/System/Text/StringBuilder.ab	(revision 496)
+++ /trunk/Include/Classes/System/Text/StringBuilder.ab	(revision 497)
@@ -1,5 +1,3 @@
 'Classes/System/Text/StringBuilder.ab
-
-#require <Classes/ActiveBasic/Strings/Strings.ab>
 
 Namespace System
@@ -7,5 +5,4 @@
 
 Class StringBuilder
-	'Inherits ISerializable
 Public
 	Sub StringBuilder()
@@ -196,8 +193,8 @@
 
 	Override Function GetHashCode() As Long
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+		Dim n = size
+#else
 		Dim n = (size + 1) >> 1
-#else
-		Dim n = size
 #endif
 		Return _System_GetHashFromWordArray(chars As *Word, n As SIZE_T) Xor capacity Xor maxCapacity
@@ -214,14 +211,14 @@
 		Return This
 	End Function
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+	Function Insert(i As Long, x As SByte) As StringBuilder
+		rangeCheck(i)
+		insertCore(i, Str$(x As Long))
+		Return This
+	End Function
+#else
 	Function Insert(i As Long, x As Word) As StringBuilder
 		rangeCheck(i)
 		insertCore(i, Str$(x As DWord))
-		Return This
-	End Function
-#else
-	Function Insert(i As Long, x As SByte) As StringBuilder
-		rangeCheck(i)
-		insertCore(i, Str$(x As Long))
 		Return This
 	End Function
Index: /trunk/Include/Classes/System/Threading/Timeout.ab
===================================================================
--- /trunk/Include/Classes/System/Threading/Timeout.ab	(revision 496)
+++ /trunk/Include/Classes/System/Threading/Timeout.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Classes/System/Threading/Timeout.ab
-
-#ifndef __SYSTEM_THREADING_TIMEOUT_AB__
-#define __SYSTEM_THREADING_TIMEOUT_AB__
 
 Namespace System
@@ -14,4 +11,2 @@
 End Namespace 'Threading
 End Namespace 'System
-
-#endif
Index: /trunk/Include/Classes/System/Version.ab
===================================================================
--- /trunk/Include/Classes/System/Version.ab	(revision 496)
+++ /trunk/Include/Classes/System/Version.ab	(revision 497)
@@ -1,8 +1,3 @@
-' System/Version.ab
-
-#ifndef __SYSTEM_VERSION_AB__
-#define __SYSTEM_VERSION_AB__
-
-#require <api_winsock2.sbp>
+' Classes/System/Version.ab
 
 Namespace System
@@ -121,6 +116,5 @@
 	Function ToString(fieldCount As Long) As String
 		If fieldCount < 0 Or fieldCount > 4 Then
-			' Throw ArgumentException
-			Debug
+			Throw New ArgumentOutOfRangeException("fieldCount")
 		End If
 		ToString = ""
@@ -132,6 +126,5 @@
 
 		If build < 0 Then
-			' Throw ArgumentException
-			Debug
+			Throw New ArgumentException
 		End If
 		ToString = ToString + "." + Str$(build)
@@ -139,6 +132,5 @@
 
 		If revision < 0 Then
-			' Throw ArgumentException
-			Debug
+			Throw New ArgumentException
 		End If
 		ToString = ToString + "." + Str$(revision)
@@ -152,4 +144,2 @@
 
 End Namespace 'System
-
-#endif '__SYSTEM_VERSION_AB__
Index: /trunk/Include/Classes/System/Xml/XmlDocument.ab
===================================================================
--- /trunk/Include/Classes/System/Xml/XmlDocument.ab	(revision 496)
+++ /trunk/Include/Classes/System/Xml/XmlDocument.ab	(revision 497)
@@ -99,5 +99,5 @@
 	Virtual Sub Load( inStream As System.IO.Stream )
 		Dim length = inStream.Length As DWord
-		Dim xmlBuffer = calloc( length + 1 ) As *StrChar
+		Dim xmlBuffer = calloc( length + 1 ) As *Char
 		inStream.Read( xmlBuffer As *Byte, 0, length )
 		inStream.Close()
@@ -124,5 +124,5 @@
 	Virtual Sub Save( outStream As System.IO.Stream )
 		Dim xmlStr = InnerXmlSupportedIndent( True )
-		outStream.Write( xmlStr.StrPtr As *Byte, 0, xmlStr.Length * SizeOf( StrChar ) )
+		outStream.Write( xmlStr.StrPtr As *Byte, 0, xmlStr.Length * SizeOf( Char ) )
 		outStream.Close()
 	End Sub
Index: /trunk/Include/GdiPlus.ab
===================================================================
--- /trunk/Include/GdiPlus.ab	(revision 496)
+++ /trunk/Include/GdiPlus.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Gdiplus.ab
-
-#ifndef GDIPLUS_AB
-#define GDIPLUS_AB
 
 Declare Function GdipAlloc Lib "Gdiplus.dll" (size As SIZE_T) As VoidPtr
@@ -17,4 +14,2 @@
 '#require <Classes/System/Drawing/Imaging/misc.ab>
 '#require <Classes/System/Drawing/Imaging/MetafileHeader.ab>
-
-#endif 'GDIPLUS_AB
Index: /trunk/Include/GdiPlusEnums.ab
===================================================================
--- /trunk/Include/GdiPlusEnums.ab	(revision 496)
+++ /trunk/Include/GdiPlusEnums.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' GdiPlusEnums.ab
-
-#ifndef __GDUPLUSENUMS_AB__
-#define __GDUPLUSENUMS_AB__
 
 Const FlatnessDefault = 1.0 / 4.0
@@ -606,5 +603,4 @@
 End Enum
 
-
 Const Enum EmfToWmfBitsFlags
 	EmfToWmfBitsFlagsDefault          = &h00000000
@@ -619,4 +615,2 @@
 	TestControlGetBuildNumber = 2
 End Enum
-
-#endif '__GDUPLUSENUMS_AB__
Index: /trunk/Include/GdiPlusFlat.ab
===================================================================
--- /trunk/Include/GdiPlusFlat.ab	(revision 496)
+++ /trunk/Include/GdiPlusFlat.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' GdiPlusFlat.ab
-
-#ifndef __GDIPLUS_FLATAPI_AB__
-#define __GDIPLUS_FLATAPI_AB__
 
 #require <GdiPlusEnums.ab>
@@ -665,4 +662,2 @@
 Declare Function  GdiplusNotificationHook Lib "gdiplus.dll" (ByRef token As ULONG_PTR) As GpStatus
 Declare Sub GdiplusNotificationUnhook Lib "gdiplus.dll" (ByVal token As ULONG_PTR)
-
-#endif '__GDIPLUS_FLATAPI_AB__
Index: /trunk/Include/GdiPlusGpStubs.ab
===================================================================
--- /trunk/Include/GdiPlusGpStubs.ab	(revision 496)
+++ /trunk/Include/GdiPlusGpStubs.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' GdiplusGpStubs.ab
-
-#ifndef __GDIPLUSGPSTUBS_AB__
-#define __GDIPLUSGPSTUBS_AB__
 
 #require <Classes/System/Drawing/Drawing2D/misc.ab>
@@ -99,5 +96,2 @@
 TypeDef GpFlushIntention = FlushIntention
 TypeDef GpPathData = PathData
-
-#endif '__GDIPLUSGPSTUBS_AB__
-
Index: /trunk/Include/GdiPlusInit.ab
===================================================================
--- /trunk/Include/GdiPlusInit.ab	(revision 496)
+++ /trunk/Include/GdiPlusInit.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' GdiPlusInit.ab
-
-#ifndef __GDIPLUSINIT_AB__
-#define __GDIPLUSINIT_AB__
 
 Enum DebugEventLevel
@@ -42,4 +39,2 @@
 
 Declare Sub GdiplusShutdown Lib "GdiPlus.dll" (ByVal token As ULONG_PTR)
-
-#endif '__GDIPLUSINIT_AB__
Index: /trunk/Include/GdiPlusTypes.ab
===================================================================
--- /trunk/Include/GdiPlusTypes.ab	(revision 496)
+++ /trunk/Include/GdiPlusTypes.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' GdiPlusTypes.sbp
-
-#ifndef __GDIPLUSTYPES_AB__
-#define __GDIPLUSTYPES_AB__
 
 TypeDef ImageAbort = *Function(p As VoidPtr) As BOOL
@@ -62,5 +59,2 @@
 */
 End Class
-
-
-#endif '__GDIPLUSTYPES_AB__
Index: /trunk/Include/OAIdl.ab
===================================================================
--- /trunk/Include/OAIdl.ab	(revision 496)
+++ /trunk/Include/OAIdl.ab	(revision 497)
@@ -4,7 +4,4 @@
 
 #require <objidl.sbp>
-
-#ifndef __IOleAutomationTypes_INTERFACE_DEFINED__
-#define __IOleAutomationTypes_INTERFACE_DEFINED__
 
 /* interface IOleAutomationTypes */
@@ -788,13 +785,6 @@
 TypeDef LPCUSTDATA = *CUSTDATA
 
-#endif /* __IOleAutomationTypes_INTERFACE_DEFINED__ */
-
-#ifndef __ICreateTypeInfo_INTERFACE_DEFINED__
-#define __ICreateTypeInfo_INTERFACE_DEFINED__
-
 /* interface ICreateTypeInfo */
 /* [local][unique][uuid][object] */
-
-TypeDef LPCREATETYPEINFO = * /* [unique] */ ICreateTypeInfo
 
 Dim IID_ICreateTypeInfo = [&h00020405, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -866,13 +856,6 @@
 End Interface
 
-#endif 	/* __ICreateTypeInfo_INTERFACE_DEFINED__ */
-
-#ifndef __ICreateTypeInfo2_INTERFACE_DEFINED__
-#define __ICreateTypeInfo2_INTERFACE_DEFINED__
-
 /* interface ICreateTypeInfo2 */
 /* [local][unique][uuid][object] */
-
-TypeDef LPCREATETYPEINFO2 = /* [unique] */ *ICreateTypeInfo2
 
 Dim IID_ICreateTypeInfo2 = [&h0002040E, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -925,14 +908,6 @@
 End Interface
 
-#endif 	/* __ICreateTypeInfo2_INTERFACE_DEFINED__ */
-
-
-#ifndef __ICreateTypeLib_INTERFACE_DEFINED__
-#define __ICreateTypeLib_INTERFACE_DEFINED__
-
 /* interface ICreateTypeLib */
 /* [local][unique][uuid][object] */
-
-TypeDef LPCREATETYPELIB = /* [unique] */ *ICreateTypeLib
 
 Dim IID_ICreateTypeLib = [&h00020406, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -964,14 +939,6 @@
 End Interface
 
-#endif 	/* __ICreateTypeLib_INTERFACE_DEFINED__ */
-
-#ifndef __ICreateTypeLib2_INTERFACE_DEFINED__
-#define __ICreateTypeLib2_INTERFACE_DEFINED__
-
 /* interface ICreateTypeLib2 */
 /* [local][unique][uuid][object] */
-
-TypeDef LPCREATETYPELIB2 = /* [unique] */ *ICreateTypeLib2
-
 
 Dim IID_ICreateTypeLib2 = [&h0002040F, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -991,14 +958,6 @@
 End Interface
 
-
-#endif 	/* __ICreateTypeLib2_INTERFACE_DEFINED__ */
-
-#ifndef __IDispatch_INTERFACE_DEFINED__
-#define __IDispatch_INTERFACE_DEFINED__
-
 /* interface IDispatch */
 /* [unique][uuid][object] */
-
-Typedef LPDISPATCH = /* [unique] */ *IDispatch
 
 Const DISPID_UNKNOWN = -1
@@ -1047,13 +1006,6 @@
 End Interface
 
-#endif 	/* __IDispatch_INTERFACE_DEFINED__ */
-
-#ifndef __IEnumVARIANT_INTERFACE_DEFINED__
-#define __IEnumVARIANT_INTERFACE_DEFINED__
-
 /* interface IEnumVARIANT */
 /* [unique][uuid][object] */
-
-Typedef LPENUMVARIANT = /* [unique] */ *IEnumVARIANT
 
 Dim IID_IEnumVARIANT = [&h00020404, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -1074,13 +1026,6 @@
 End Interface
 
-#endif 	/* __IEnumVARIANT_INTERFACE_DEFINED__ */
-
-#ifndef __ITypeComp_INTERFACE_DEFINED__
-#define __ITypeComp_INTERFACE_DEFINED__
-
 /* interface ITypeComp */
 /* [unique][uuid][object] */
-
-TypeDef LPTYPECOMP = /* [unique] */ *ITypeComp
 
 /* [v1_enum] */
@@ -1126,13 +1071,6 @@
 End Interface
 
-#endif 	/* __ITypeComp_INTERFACE_DEFINED__ */
-
-#ifndef __ITypeInfo_INTERFACE_DEFINED__
-#define __ITypeInfo_INTERFACE_DEFINED__
-
 /* interface ITypeInfo */
 /* [unique][uuid][object] */
-
-TypeDef LPTYPEINFO = /* [unique] */ *ITypeInfo
 
 Dim IID_ITypeInfo = [&h00020401, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -1211,13 +1149,6 @@
 End Interface
 
-#endif 	/* __ITypeInfo_INTERFACE_DEFINED__ */
-
-#ifndef __ITypeInfo2_INTERFACE_DEFINED__
-#define __ITypeInfo2_INTERFACE_DEFINED__
-
 /* interface ITypeInfo2 */
 /* [unique][uuid][object] */
-
-TypeDef LPTYPEINFO2 = /* [unique] */ *ITypeInfo2
 
 Dim IID_ITypeInfo2 = [&h00020412, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -1279,9 +1210,4 @@
 		/* [out] */ ByRef CustData As CUSTDATA) As HRESULT
 End Interface
-
-#endif 	/* __ITypeInfo2_INTERFACE_DEFINED__ */
-
-#ifndef __ITypeLib_INTERFACE_DEFINED__
-#define __ITypeLib_INTERFACE_DEFINED__
 
 /* interface ITypeLib */
@@ -1356,14 +1282,6 @@
 End Interface
 
-#endif 	/* __ITypeLib_INTERFACE_DEFINED__ */
-
-
-#ifndef __ITypeLib2_INTERFACE_DEFINED__
-#define __ITypeLib2_INTERFACE_DEFINED__
-
 /* interface ITypeLib2 */
 /* [unique][uuid][object] */
-
-TypeDef LPTYPELIB2 = /* [unique] */ *ITypeLib2
 
 Dim IID_ITypeLib2 = [&h00020411, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -1379,23 +1297,15 @@
 		/* [out] */ ByRef chUniqueNames As DWord) As HRESULT
 	/* [local] */ Function GetDocumentation2(
-            /* [in] */ index As Long,
-            /* [in] */ lcid As LCID,
-            /* [out] */ ByRef bstrHelpString As BSTR,
-            /* [out] */ ByRef dwHelpStringContext As DWord,
-            /* [out] */ ByRef bstrHelpStringDll As BSTR) As HRESULT
+		/* [in] */ index As Long,
+		/* [in] */ lcid As LCID,
+		/* [out] */ ByRef bstrHelpString As BSTR,
+		/* [out] */ ByRef dwHelpStringContext As DWord,
+		/* [out] */ ByRef bstrHelpStringDll As BSTR) As HRESULT
 	Function GetAllCustData(
 		/* [out] */ ByRef CustData As CUSTDATA) As HRESULT
 End Interface
 
-#endif 	/* __ITypeLib2_INTERFACE_DEFINED__ */
-
-
-#ifndef __ITypeChangeEvents_INTERFACE_DEFINED__
-#define __ITypeChangeEvents_INTERFACE_DEFINED__
-
 /* interface ITypeChangeEvents */
 /* [local][unique][uuid][object] */
-
-TypeDef LPTYPECHANGEEVENTS = /* [unique] */ *ITypeChangeEvents
 
 Enum CHANGEKIND
@@ -1426,14 +1336,6 @@
 End Interface
 
-#endif 	/* __ITypeChangeEvents_INTERFACE_DEFINED__ */
-
-
-#ifndef __IErrorInfo_INTERFACE_DEFINED__
-#define __IErrorInfo_INTERFACE_DEFINED__
-
 /* interface IErrorInfo */
 /* [unique][uuid][object] */
-
-TypeDef LPERRORINFO = /* [unique] */ *IErrorInfo
 
 Dim IID_IErrorInfo = [&h1CF2B120, &h547D, &h101B, [&h8E, &h65, &h08, &h00, &h2B, &h2B, &hD1, &h19]] As IID
@@ -1454,10 +1356,4 @@
 End Interface
 
-#endif 	/* __IErrorInfo_INTERFACE_DEFINED__ */
-
-
-#ifndef __ICreateErrorInfo_INTERFACE_DEFINED__
-#define __ICreateErrorInfo_INTERFACE_DEFINED__
-
 /* interface ICreateErrorInfo */
 /* [unique][uuid][object] */
@@ -1482,15 +1378,7 @@
 End Interface
 
-#endif 	/* __ICreateErrorInfo_INTERFACE_DEFINED__ */
-
-
-#ifndef __ISupportErrorInfo_INTERFACE_DEFINED__
-#define __ISupportErrorInfo_INTERFACE_DEFINED__
-
 /* interface ISupportErrorInfo */
 /* [unique][uuid][object] */
 
-TypeDef LPSUPPORTERRORINFO = /* [unique] */ *ISupportErrorInfo
-
 Dim IID_ISupportErrorInfo = [&hDF0B3D60, &h548F, &h101B, [&h8E, &h65, &h08, &h00, &h2B, &h2B, &hD1, &h19]] As IID
 
@@ -1501,10 +1389,4 @@
 		/* [in] */ ByRef riid As IID) As HRESULT
 End Interface
-
-#endif 	/* __ISupportErrorInfo_INTERFACE_DEFINED__ */
-
-
-#ifndef __ITypeFactory_INTERFACE_DEFINED__
-#define __ITypeFactory_INTERFACE_DEFINED__
 
 /* interface ITypeFactory */
@@ -1521,10 +1403,4 @@
 		/* [iid_is][out] */ ByRef pv As IUnknown) As HRESULT
 End Interface
-
-#endif 	/* __ITypeFactory_INTERFACE_DEFINED__ */
-
-
-#ifndef __ITypeMarshal_INTERFACE_DEFINED__
-#define __ITypeMarshal_INTERFACE_DEFINED__
 
 /* interface ITypeMarshal */
@@ -1558,14 +1434,6 @@
 End Interface
 
-#endif 	/* __ITypeMarshal_INTERFACE_DEFINED__ */
-
-
-#ifndef __IRecordInfo_INTERFACE_DEFINED__
-#define __IRecordInfo_INTERFACE_DEFINED__
-
 /* interface IRecordInfo */
 /* [uuid][object][local] */
-
-TypeDef LPRECORDINFO = /* [unique] */ *IRecordInfo
 
 Dim IID_IRecordInfo = [&h0000002F, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
@@ -1621,14 +1489,6 @@
 End Interface
 
-#endif 	/* __IRecordInfo_INTERFACE_DEFINED__ */
-
-
-#ifndef __IErrorLog_INTERFACE_DEFINED__
-#define __IErrorLog_INTERFACE_DEFINED__
-
 /* interface IErrorLog */
 /* [unique][uuid][object] */
-
-TypeDef LPERRORLOG = *IErrorLog
 
 Dim IID_IErrorLog = [&h3127CA40, &h446E, &h11CE, [&h81, &h35, &h00, &hAA, &h00, &h4B, &hB8, &h51]] As IID
@@ -1642,14 +1502,6 @@
 End Interface
 
-#endif 	/* __IErrorLog_INTERFACE_DEFINED__ */
-
-
-#ifndef __IPropertyBag_INTERFACE_DEFINED__
-#define __IPropertyBag_INTERFACE_DEFINED__
-
 /* interface IPropertyBag */
 /* [unique][uuid][object] */
-
-TypeDef LPPROPERTYBAG = *IPropertyBag
 
 Dim IID_IPropertyBag = [&h55272A00, &h42CB, &h11CE, [&h81, &h35, &h00, &hAA, &h00, &h4B, &hB8, &h51]] As IID
@@ -1667,5 +1519,2 @@
 		/* [in] */ ByRef Var As VARIANT) As HRESULT
 End Interface
-
-#endif 	/* __IPropertyBag_INTERFACE_DEFINED__ */
-
Index: /trunk/Include/OleAuto.ab
===================================================================
--- /trunk/Include/OleAuto.ab	(revision 496)
+++ /trunk/Include/OleAuto.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' OleAuto.ab
-
-#ifndef _INC_OLEAUTO_AB
-#define _INC_OLEAUTO_AB
 
 ' EXTERN_C const IID IID_StdOle;
@@ -15,13 +12,5 @@
 Const STDOLE2_LCID = &h0000
 
-/*
-#ifndef _LCID_DEFINED
-TypeDef LCID = DWord
-#define _LCID_DEFINED
-#endif
-*/
-
 #require <oaidl.ab>
-'Dummy
 
 ' BSTR API
@@ -571,7 +560,4 @@
 Declare Function VarTokenizeFormatString Lib "oleaut32" (pstrFormat As LPOLESTR, rgbTok As *Byte, cbTok As Long, iFirstDay As Long, iFirstWeek As Long, lcid As LCID, ByRef cbActual As Long) As HRESULT
 
-' ITypeLib
-TypeDef PTYPELIB = *ITypeLib
-
 ' ITypeInfo
 TypeDef DISPID = Long
@@ -627,5 +613,4 @@
 
 ' IDispatch implementation support
-TypeDef LPDISPATCH = *IDispatch
 
 Type PARAMDATA
@@ -683,4 +668,2 @@
 Declare Function OaBuildVersion Lib "oleaut32" () As DWord
 Declare Sub ClearCustData Lib "oleaut32" (ByRef CustData As CUSTDATA)
-
-#endif '_INC_OLEAUTO_AB
Index: /trunk/Include/WinNT.ab
===================================================================
--- /trunk/Include/WinNT.ab	(revision 496)
+++ /trunk/Include/WinNT.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' winnt.ab
-
-#ifndef _WINNT_
-#define _WINNT_
 
 '#include <ctype.h>
@@ -72,11 +69,8 @@
 #endif
 
-'#ifndef VOID
-'#define VOID void
 TypeDef CHAR = SByte
 TypeDef SHORT = Integer
 TypeDef LONG = Long
 TypeDef INT = Long
-'#endif
 
 TypeDef WCHAR = Word
@@ -138,12 +132,8 @@
 
 #ifdef UNICODE
-
-#ifndef _TCHAR_DEFINED
 TypeDef TCHAR = WCHAR
 TypeDef PTCHAR = *WCHAR
 TypeDef TBYTE = WCHAR
 TypeDef PTBYTE = *WCHAR
-#define _TCHAR_DEFINED
-#endif
 
 TypeDef PTCH = PWCH
@@ -158,14 +148,9 @@
 TypeDef LPCUTSTR = LPCUWSTR
 'TypeDef LP = LPWSTR
-
 #else
-
-#ifndef _TCHAR_DEFINED
 TypeDef TCHAR = Char
 TypeDef PTCHAR = *Char
 TypeDef TBYTE = Byte
 TypeDef PTBYTE = *Byte
-#define _TCHAR_DEFINED
-#endif
 
 TypeDef PTCH = PCH
@@ -191,8 +176,5 @@
 TypeDef FLONG = DWord
 
-#ifndef _HRESULT_DEFINED
-#define _HRESULT_DEFINED
 TypeDef HRESULT = Long
-#endif
 
 TypeDef CCHAR = CHAR
@@ -212,10 +194,8 @@
 TypeDef PFLOAT128 = FLOAT128
 
-'#define _ULONGLONG_
 TypeDef LONGLONG = Int64
 TypeDef ULONGLONG = QWord
 
 Const MAXLONGLONG = (&h7fffffffffffffff)
-'#endif
 
 TypeDef PLONGLONG = *LONGLONG
@@ -242,5 +222,4 @@
 TypeDef PLUID = *LUID
 
-'#define _DWORDLONG_
 'TypeDef DWORDLONG = ULONGLONG
 'TypeDef PDWORDLONG = DWORDLONG
@@ -285,12 +264,8 @@
 #require <guiddef.ab>
 
-#ifndef __OBJECTID_DEFINED
-#define __OBJECTID_DEFINED
-
 Type OBJECTID
 	Lineage As GUID
 	Uniquifier As DWord
 End Type
-#endif
 
 Const MINCHAR = &h80
@@ -1077,7 +1052,4 @@
 #endif
 
-#ifndef _LDT_ENTRY_DEFINED
-#define _LDT_ENTRY_DEFINED
-
 Type LDT_ENTRY
 	LimitLow As Word
@@ -1089,6 +1061,4 @@
 End Type
 TypeDef PLDT_ENTRY = *LDT_ENTRY
-
-#endif
 
 Const WOW64_CONTEXT_i386 = &h00010000
@@ -1250,14 +1220,9 @@
 ' Security Id (SID)
 
-#ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
-#define SID_IDENTIFIER_AUTHORITY_DEFINED
 Type SID_IDENTIFIER_AUTHORITY
 	Value[ELM(6)] As Byte
 End Type
 TypeDef PSID_IDENTIFIER_AUTHORITY = *SID_IDENTIFIER_AUTHORITY
-#endif
-
-#ifndef SID_DEFINED
-#define SID_DEFINED
+
 Type SID
 	Revision As Byte
@@ -1267,5 +1232,4 @@
 End Type
 TypeDef PSID = *SID
-#endif
 
 Const SID_REVISION = (1)
@@ -4191,34 +4155,10 @@
 
 Const BTYPE(x) = ((x) And N_BTMASK)
-
-#ifndef ISPTR
-#define ISPTR
 Const ISPTR(x) = (((x) And N_TMASK) = (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
-#endif
-
-#ifndef ISFCN
-#define ISFCN
 Const ISFCN(x) = (((x) And N_TMASK) = (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
-#endif
-
-#ifndef ISARY
-#define ISARY
 Const ISARY(x) = (((x) And N_TMASK) = (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
-#endif
-
-#ifndef ISTAG
-#define ISTAG
 Const ISTAG(x) = ((x) = IMAGE_SYM_CLASS_STRUCT_TAG Or (x) = IMAGE_SYM_CLASS_UNION_TAG Or (x) = IMAGE_SYM_CLASS_ENUM_TAG)
-#endif
-
-#ifndef INCREF
-#define INCREF
 Const INCREF(x) = ((((x) And (Not N_BTMASK)) << N_TSHIFT) Or (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT) Or ((x) And N_BTMASK))
-#endif
-
-#ifndef DECREF
-#define DECREF
 Const DECREF(x) = ((((x) >> N_TSHIFT) And (Not N_BTMASK)) Or ((x) And N_BTMASK))
-#endif
 
 ' Auxiliary entry format.
@@ -5196,10 +5136,4 @@
 #endif
 
-' for move macros
-'#include <string.h>
-
-#ifndef _SLIST_HEADER_
-#define _SLIST_HEADER_
-
 #ifdef _WIN64
 Type Align(16) SLIST_ENTRY
@@ -5254,5 +5188,4 @@
 #endif
 
-#endif
 
 Declare Sub RtlInitializeSListHead Lib "kernel32" (/*IN*/ ByRef ListHead As SLIST_HEADER)
@@ -5263,7 +5196,4 @@
 Declare Function RtlQueryDepthSList Lib "kernel32" (/*IN*/ ByRef ListHead As SLIST_HEADER) As Word
 
-#ifndef _RTL_RUN_ONCE_DEF
-#define _RTL_RUN_ONCE_DEF
-
 'Const RTL_RUN_ONCE_INIT {0} 'Static initializer
 
@@ -5280,5 +5210,4 @@
 
 TypeDef PRTL_RUN_ONCE_INIT_FN = *Function(ByRef RunOnce As RTL_RUN_ONCE, Parameter As VoidPtr, ByRef Context As VoidPtr) As DWord'LOGICAL
-#endif
 
 Declare Sub RtlRunOnceInitialize Lib "kernel32" (ByRef RunOnce As RTL_RUN_ONCE)
@@ -6108,6 +6037,6 @@
 End Enum
 
-#ifndef _NTTMAPI_
-#define _NTTMAPI_
+'#ifndef _NTTMAPI_
+'#define _NTTMAPI_
 
 '#include <ktmtypes.ab>
@@ -6170,5 +6099,4 @@
 End Enum
 
-
 Enum TRANSACTION_STATE
 	TransactionStateNormal = 1
@@ -6321,5 +6249,5 @@
 TypeDef PKTMOBJECT_CURSOR = *KTMOBJECT_CURSOR
 
-#endif
+'#endif
 
 TypeDef TP_VERSION = DWord
@@ -6439,3 +6367,2 @@
 '#endif // winnt_only
 
-#endif
Index: /trunk/Include/api_commdlg.sbp
===================================================================
--- /trunk/Include/api_commdlg.sbp	(revision 496)
+++ /trunk/Include/api_commdlg.sbp	(revision 497)
@@ -1,6 +1,3 @@
 ' api_commdlg.sbp
-
-#ifndef _INC_COMMDLG
-#define _INC_COMMDLG
 
 #ifdef UNICODE
@@ -485,5 +482,2 @@
 #endif
 Declare Function PrintDlg Lib "comdlg32" Alias _FuncName_PrintDlg (ByRef pd As PRINTDLG) As BOOL
-
-
-#endif '_INC_COMMDLG
Index: /trunk/Include/api_console.sbp
===================================================================
--- /trunk/Include/api_console.sbp	(revision 496)
+++ /trunk/Include/api_console.sbp	(revision 497)
@@ -1,6 +1,3 @@
 'api_console.sbp
-
-#ifndef _INC_CONSOLE
-#define _INC_CONSOLE
 
 #ifdef UNICODE
@@ -225,6 +222,2 @@
 Declare Function GetConsoleOutputCP Lib "kernel32" () As DWord
 Declare Function SetConsoleOutputCP Lib "kernel32" (wCodePageID As DWord) As BOOL
-
-
-
-#endif '_INC_CONSOLE
Index: /trunk/Include/api_gdi.sbp
===================================================================
--- /trunk/Include/api_gdi.sbp	(revision 496)
+++ /trunk/Include/api_gdi.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' api_gdi.sbp - Graphics Device Integerface API
-
-
-#ifndef _INC_GDI
-#define _INC_GDI
 
 #ifdef UNICODE
@@ -1344,4 +1340,2 @@
 
 'Declare Function wglSwapMultipleBuffers Lib "opengl32" (u As DWord, lpwglswap As *WGLSWAP) As DWord
-
-#endif '_INC_GDI
Index: /trunk/Include/api_imm.sbp
===================================================================
--- /trunk/Include/api_imm.sbp	(revision 496)
+++ /trunk/Include/api_imm.sbp	(revision 497)
@@ -250,5 +250,4 @@
 Declare Function ImmSetOpenStatus Lib "imm32" (himc As HIMC, fOpen As BOOL) As BOOL
 
-#ifdef _INC_GDI '_WINGDI_
 #ifndef NOGDI
 Declare Function ImmGetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTA) As BOOL
@@ -268,5 +267,4 @@
 #endif
 #endif 'NOGDI
-#endif '_INC_GDI
 
 Declare Function ImmConfigureIMEA Lib "imm32" (hkl As HKL, hwnd As HWND, dwMode As DWord, lpData As VoidPtr) As BOOL
Index: /trunk/Include/api_msg.sbp
===================================================================
--- /trunk/Include/api_msg.sbp	(revision 496)
+++ /trunk/Include/api_msg.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' api_msg.sbp - declarations file for window control.
-
-
-#ifndef _INC_MSG
-#define _INC_MSG
-
 
 '------------------------------
@@ -1061,5 +1056,2 @@
 Const CBN_SELENDOK =      9
 Const CBN_SELENDCANCEL =  10
-
-
-#endif '_INC_MSG
Index: /trunk/Include/api_psapi.sbp
===================================================================
--- /trunk/Include/api_psapi.sbp	(revision 496)
+++ /trunk/Include/api_psapi.sbp	(revision 497)
@@ -1,6 +1,3 @@
 ' api_psapi.sbp
-
-#ifndef _INC_PSAPI_
-#define _INC_PSAPI_
 
 #ifdef UNICODE
@@ -128,4 +125,2 @@
 Declare Function EnumPageFiles Lib "psapi" Alias _FuncName_EnumPageFiles (pCallBackRoutine As PENUM_PAGE_FILE_CALLBACK, pContext As VoidPtr) As BOOL
 Declare Function GetProcessImageFileName Lib "psapi" Alias _FuncName_GetProcessImageFileName (hProcess As HANDLE, lpImageFileName As LPTSTR, nSize As DWord) As DWORD
-
-#endif '_INC_PSAPI
Index: /trunk/Include/api_reg.sbp
===================================================================
--- /trunk/Include/api_reg.sbp	(revision 496)
+++ /trunk/Include/api_reg.sbp	(revision 497)
@@ -1,8 +1,4 @@
 ' api_reg.sbp
 ' Registry Operation
-
-
-#ifndef _INC_REG
-#define _INC_REG
 
 #ifdef UNICODE
@@ -165,3 +161,2 @@
 Declare Function RegSaveKeyEx Lib "advapi32" Alias _FuncName_RegSaveKeyEx (hKey As HKEY, lpFile As LPCTSTR, lpSecurityAttributes As *SECURITY_ATTRIBUTES, Flags As DWord) As Long
 '#endif
-#endif '_INC_REG
Index: /trunk/Include/api_shell.sbp
===================================================================
--- /trunk/Include/api_shell.sbp	(revision 496)
+++ /trunk/Include/api_shell.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' api_shell.sbp
-
-
-#ifndef _INC_SHELL
-#define _INC_SHELL
 
 #ifdef UNICODE
@@ -712,4 +708,2 @@
 		/* [out] */ ByRef ppidlOut As LPITEMIDLIST) As HRESULT
 End Interface
-
-#endif '_INC_SHELL
Index: /trunk/Include/api_shlwapi.sbp
===================================================================
--- /trunk/Include/api_shlwapi.sbp	(revision 496)
+++ /trunk/Include/api_shlwapi.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' api_shlwapi.sbp
-
-
-#ifndef _INC_SHLWAPI
-#define _INC_SHLWAPI
-
 
 Declare Function PathGetArgsA Lib "shlwapi" (pszPath As LPCWSTR) As LPWSTR
@@ -86,4 +81,2 @@
 Declare Function PathRenameExtension Lib "shlwapi" Alias "PathRenameExtensionA" (hKey As HKEY, pszSubKey As LPCSTR) As DWord
 #endif
-
-#endif '_INC_SHLWAPI
Index: /trunk/Include/api_sql.sbp
===================================================================
--- /trunk/Include/api_sql.sbp	(revision 496)
+++ /trunk/Include/api_sql.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' api_sql.sbp
-
-#ifndef _INC_SQL
-#define _INC_SQL
-
 
 /* API declaration data types */
@@ -809,5 +805,2 @@
 Declare Function SQLTransact Lib "odbc32.dll" (EnvironmentHandle As SQLHENV,
            ConnectionHandle As SQLHDBC, CompletionType As SQLUSMALLINT) As SQLRETURN
-
-
-#endif '_INC_SQL
Index: /trunk/Include/api_sqlext.sbp
===================================================================
--- /trunk/Include/api_sqlext.sbp	(revision 496)
+++ /trunk/Include/api_sqlext.sbp	(revision 497)
@@ -1,12 +1,5 @@
 ' api_sqlext.sbp
 
-
-#ifndef _INC_SQLEXT
-#define _INC_SQLEXT
-
-#ifndef _INC_SQL
-#include <api_sql.sbp>
-#endif
-
+#require <api_sql.sbp>
 
 /* generally useful constants */
@@ -1793,5 +1786,2 @@
 	RetCode As RETCODE
 End Type
-
-
-#endif /* _INC_SQLEXT */
Index: /trunk/Include/api_system.sbp
===================================================================
--- /trunk/Include/api_system.sbp	(revision 496)
+++ /trunk/Include/api_system.sbp	(revision 497)
@@ -1,6 +1,3 @@
 ' api_system.sbp - System API
-
-#ifndef _INC_SYSTEM
-#define _INC_SYSTEM
 
 #ifdef UNICODE
@@ -970,4 +967,2 @@
 Const MAKEINTATOM(i) = (i As Word As ULONG_PTR As LPTSTR)
 Const INVALID_ATOM = 0 As ATOM
-
-#endif '_INC_SYSTEM
Index: /trunk/Include/api_tlhelp32.sbp
===================================================================
--- /trunk/Include/api_tlhelp32.sbp	(revision 496)
+++ /trunk/Include/api_tlhelp32.sbp	(revision 497)
@@ -1,6 +1,3 @@
 ' api_tlhelp32.sbp
-
-#ifndef _INC_TOOLHELP32
-#define _INC_TOOLHELP32
 
 Const MAX_MODULE_NAME32 = 255
@@ -134,6 +131,2 @@
 Declare Function Module32First Lib "kernel32" (hSnapshot As HANDLE, ByRef me As MODULEENTRY32) As BOOL
 Declare Function Module32Next Lib "kernel32" (hSnapshot As HANDLE, ByRef me As MODULEENTRY32) As BOOL
-
-
-
-#endif ' _INC_TOOLHELP32
Index: /trunk/Include/api_window.sbp
===================================================================
--- /trunk/Include/api_window.sbp	(revision 496)
+++ /trunk/Include/api_window.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' api_window.sbp - Window Control API
-
-
-#ifndef _INC_WINDOW
-#define _INC_WINDOW
 
 '-------------
@@ -1647,5 +1643,5 @@
 	lfMessageFont As LOGFONTA
 End Type
-#ifdef
+#ifdef UNICODE
 TypeDef NONCLIENTMETRICS = NONCLIENTMETRICSW
 #else
@@ -2131,3 +2127,2 @@
 Declare Function GetAltTabInfo Lib "user32" Alias "GetAltTabInfoA" (ByVal hwnd As HWND, ByVal iItem As Long, ByRef pati As ALTTABINFO, ByVal pszItemText As LPSTR, ByVal cchItemText As DWord) As BOOL
 #endif ' !UNICODE
-#endif '_INC_WINDOW
Index: /trunk/Include/api_windowstyles.sbp
===================================================================
--- /trunk/Include/api_windowstyles.sbp	(revision 496)
+++ /trunk/Include/api_windowstyles.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' api_windowstyles.sbp
-
-
-#ifndef _INC_WINDOWSTYLES
-#define _INC_WINDOWSTYLES
-
 
 '---------------
@@ -237,5 +232,2 @@
 Const DS_CENTERMOUSE =    &H1000
 Const DS_CONTEXTHELP =    &H2000
-
-
-#endif '_INC_WINDOWSTYLES
Index: /trunk/Include/api_winerror.sbp
===================================================================
--- /trunk/Include/api_winerror.sbp	(revision 496)
+++ /trunk/Include/api_winerror.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' api_winerror.sbp
-
-
-#ifndef _INC_WINERROR
-#define _INC_WINERROR
 
 Const FACILITY_WINDOWSUPDATE = 36
@@ -1608,6 +1604,5 @@
 Const DNS_ERROR_DP_NOT_AVAILABLE = 9905
 Const DNS_ERROR_DP_FSMO_ERROR = 9906
-#ifndef WSABASEERR
-#define WSABASEERR
+
 Const WSABASEERR = 10000
 Const WSAEINTR = 10004
@@ -1700,5 +1695,5 @@
 Const WSA_QOS_ESHAPERATEOBJ = 11030
 Const WSA_QOS_RESERVED_PETYPE = 11031
-#endif
+
 Const ERROR_SXS_SECTION_NOT_FOUND = 14000
 Const ERROR_SXS_CANT_GEN_ACTCTX = 14001
@@ -3098,4 +3093,2 @@
 Const COMADMIN_E_REGISTRY_ACCESSDENIED = _HRESULT_TYPEDEF_(&h80110823)
 Const COMADMIN_E_PARTITIONS_DISABLED = _HRESULT_TYPEDEF_(&h80110824)
-
-#endif '_INC_WINERROR
Index: /trunk/Include/api_wininet.sbp
===================================================================
--- /trunk/Include/api_wininet.sbp	(revision 496)
+++ /trunk/Include/api_wininet.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' api_wininet.sbp
-
-
-#ifndef _INC_WININET
-#define _INC_WININET
 
 #ifdef UNICODE
@@ -107,5 +103,2 @@
 	hFind As HINTERNET,
 	ByREf vFindData As Any) As BOOL
-
-
-#endif '_INC_WININET
Index: /trunk/Include/api_winsock2.sbp
===================================================================
--- /trunk/Include/api_winsock2.sbp	(revision 496)
+++ /trunk/Include/api_winsock2.sbp	(revision 497)
@@ -2,13 +2,4 @@
 #define _WINSOCK2API_
 #define _WINSOCKAPI_
-/*
-#ifndef INCL_WINSOCK_API_PROTOTYPES
-#define INCL_WINSOCK_API_PROTOTYPES 1
-#endif
-
-#ifndef INCL_WINSOCK_API_TYPEDEFS
-#define INCL_WINSOCK_API_TYPEDEFS 0
-#endif
-*/
 
 Const WINSOCK_VERSION = MAKEWORD(2, 2)
@@ -218,6 +209,4 @@
 Const IMPLINK_HIGHEXPER = 158
 
-#ifndef s_addr
-#define s_addr
 ' Internet address (old style... should be updated)
 Type /*Class*/ in_addr
@@ -281,5 +270,4 @@
 */
 End Type 'Class
-#endif
 
 Const IN_CLASSA(i) = (((i) As DWord And &h80000000) = 0)
@@ -557,5 +545,5 @@
 Const FD_ALL_EVENTS = ((1 << FD_MAX_EVENTS) - 1)
 
-#include <api_winerror.sbp>
+#require <api_winerror.sbp>
 
 ' Compatibility macros.
@@ -602,5 +590,5 @@
 TypeDef LPWSABUF = *WSABUF
 
-#include <qos.ab>
+#require <qos.ab>
 
 Type QOS 'struct _QualityOfService
@@ -918,8 +906,4 @@
 ' registration (RNR) API
 
-#ifndef _tagBLOB_DEFINED
-#define _tagBLOB_DEFINED
-#define _BLOB_DEFINED
-#define _LPBLOB_DEFINED
 Type BLOB
 	cbSize As DWord
@@ -931,5 +915,4 @@
 End Type
 TypeDef LPBLOB = *BLOB
-#endif
 
 ' Service Install Flags
@@ -970,43 +953,39 @@
 Const RES_UNUSED_1 = (&h00000001)
 Const RES_FLUSH_CACHE = (&h00000002)
-#ifndef RES_SERVICE
-#define RES_SERVICE
 Const RES_SERVICE = (&h00000004)
-#endif /* RES_SERVICE */
 
 ' Well known value names for Service Types
 
-Const SERVICE_TYPE_VALUE_IPXPORTA = "IpxSocket"
+'Const SERVICE_TYPE_VALUE_IPXPORTA = "IpxSocket"
 'Const SERVICE_TYPE_VALUE_IPXPORTW = L"IpxSocket"
-Const SERVICE_TYPE_VALUE_SAPIDA = "SapId"
+'Const SERVICE_TYPE_VALUE_SAPIDA = "SapId"
 'Const SERVICE_TYPE_VALUE_SAPIDW = L"SapId"
 
-Const SERVICE_TYPE_VALUE_TCPPORTA = "TcpPort"
+'Const SERVICE_TYPE_VALUE_TCPPORTA = "TcpPort"
 'Const SERVICE_TYPE_VALUE_TCPPORTW = L"TcpPort"
 
-Const SERVICE_TYPE_VALUE_UDPPORTA = "UdpPort"
+'Const SERVICE_TYPE_VALUE_UDPPORTA = "UdpPort"
 'Const SERVICE_TYPE_VALUE_UDPPORTW = L"UdpPort"
 
-Const SERVICE_TYPE_VALUE_OBJECTIDA = "ObjectId"
+'Const SERVICE_TYPE_VALUE_OBJECTIDA = "ObjectId"
 'Const SERVICE_TYPE_VALUE_OBJECTIDW = L"ObjectId"
-
-#ifdef UNICODE
 /*
+#ifdef UNICODE
 Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDW
 Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTW
 Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTW
 Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDW
-*/
-#else
-
+#else
 Const SERVICE_TYPE_VALUE_SAPID = SERVICE_TYPE_VALUE_SAPIDA
 Const SERVICE_TYPE_VALUE_TCPPORT = SERVICE_TYPE_VALUE_TCPPORTA
 Const SERVICE_TYPE_VALUE_UDPPORT = SERVICE_TYPE_VALUE_UDPPORTA
 Const SERVICE_TYPE_VALUE_OBJECTID = SERVICE_TYPE_VALUE_OBJECTIDA
-
-#endif
-
-#ifndef __CSADDR_DEFINED__
-#define __CSADDR_DEFINED__
+#endif
+*/
+Const SERVICE_TYPE_VALUE_IPXPORT = "IpxSocket"
+Const SERVICE_TYPE_VALUE_SAPID = "SapId"
+Const SERVICE_TYPE_VALUE_TCPPORT = "TcpPort"
+Const SERVICE_TYPE_VALUE_UDPPORT = "UdpPort"
+Const SERVICE_TYPE_VALUE_OBJECTID = "ObjectId"
 
 ' SockAddr Information
@@ -1027,5 +1006,4 @@
 TypeDef PCSADDR_INFO = *CSADDR_INFO
 TypeDef LPCSADDR_INFO = *CSADDR_INFO
-#endif
 
 ' Address list returned via SIO_ADDRESS_LIST_QUERY
@@ -2136,7 +2114,7 @@
 Const WSAGETSELECTERROR(lParam) = HIWORD(lParam)
 
-#ifdef IPV6STRICT
-'#include <wsipv6ok.ab>
-#endif
-
-#endif
+'#ifdef IPV6STRICT
+'#require <wsipv6ok.ab>
+'#endif
+
+#endif
Index: /trunk/Include/api_winspool.sbp
===================================================================
--- /trunk/Include/api_winspool.sbp	(revision 496)
+++ /trunk/Include/api_winspool.sbp	(revision 497)
@@ -1,7 +1,3 @@
 'api_winspool.sbp
-
-
-#ifndef _INC_WINSPOOL
-#define _INC_WINSPOOL
 
 #ifdef UNICODE
@@ -60,5 +56,2 @@
 Const SPOOL_FILE_PERSISTENT    = &H00000001
 Const SPOOL_FILE_TEMPORARY     = &H00000002
-
-
-#endif '_INC_WINSPOOL
Index: /trunk/Include/basic.sbp
===================================================================
--- /trunk/Include/basic.sbp	(revision 496)
+++ /trunk/Include/basic.sbp	(revision 497)
@@ -2,10 +2,4 @@
 
 #_core
-
-' Unicodeが不安定な間の暫定対応
-#define __STRING_IS_NOT_ALWAYS_UNICODE
-
-#ifndef _INC_BASIC
-#define _INC_BASIC
 
 Sub _System_InitDllGlobalVariables()	'dummy
@@ -186,5 +180,2 @@
 #require <basic\function.sbp>
 #require <basic\command.sbp>
-
-
-#endif '_INC_BASIC
Index: /trunk/Include/basic/command.sbp
===================================================================
--- /trunk/Include/basic/command.sbp	(revision 496)
+++ /trunk/Include/basic/command.sbp	(revision 497)
@@ -1,7 +1,3 @@
 'command.sbp
-
-
-#ifndef _INC_COMMAND
-#define _INC_COMMAND
 
 Const _System_Type_SByte = 1
@@ -152,8 +148,8 @@
 Sub INPUT_FromFile(FileNumber As Long)
 	FileNumber--
-	
+
 	Dim i = 0 As Long
 	Dim buffer = New System.Text.StringBuilder(256)
-	Dim temp[1] As StrChar
+	Dim temp[1] As Char
 	Dim dwAccessBytes As DWord
 	Dim IsStr As Long
@@ -162,5 +158,5 @@
 		'次のデータをサーチ
 		Do
-			Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)
+			Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0)
 			If ret=0 or dwAccessBytes=0 Then
 				'error
@@ -173,5 +169,5 @@
 		IsStr=0
 		While 1
-			Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)
+			Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0)
 			If ret = 0 or dwAccessBytes = 0 Then
 				'error
@@ -183,5 +179,5 @@
 			If dwAccessBytes=0 or temp[0]=0 or temp[0]=13 or temp[0]=10 or (IsStr=0 and temp[0]=Asc(",")) or (IsStr=0 and (temp[0]=32 or temp[0]=9) and _System_InputDataType[i]<>_System_Type_String) Then
 				If temp[0]=13 Then
-					ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)
+					ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0)
 					If Not(dwAccessBytes<>0 And temp[0]=10) Then
 						SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT)
@@ -202,5 +198,5 @@
 				End If
 
-				buffer.Append(0 As StrChar)
+				buffer.Append(0 As Char)
 				Exit While
 			End If
@@ -252,5 +248,5 @@
 Function _System_GetUsingFormat(UsingStr As String) As String
 	Dim i2 As Long, i3 As Long, i4 As Long, i5 As Long, ParmNum As Long
-	Dim temporary[255] As StrChar
+	Dim temporary[255] As Char
 	Dim buffer = New System.Text.StringBuilder(1024)
 
@@ -270,5 +266,5 @@
 		If UsingStr[i2]=Asc("#") Then
 			Dim dec As Long, sign As Long
-			Dim temp2 As *StrChar
+			Dim temp2 As *Char
 
 			Dim length_num As Long, length_buf As Long
@@ -325,5 +321,5 @@
 
 				If dec > 0 Then
-					memcpy(VarPtr(buffer.Chars[i3]), temp2, SizeOf (StrChar) * length_num)
+					memcpy(VarPtr(buffer.Chars[i3]), temp2, SizeOf (Char) * length_num)
 				Else
 					buffer[i3] = &H30
@@ -376,5 +372,5 @@
 					ActiveBasic.Strings.Detail.ChrFill(VarPtr(buffer.Chars[i3]), i4, &h20) 'Asc(" ")
 				End If
-				memcpy(VarPtr(buffer.Chars[i3]), _System_UsingStrData[ParmNum], SizeOf (StrChar) * i5)
+				memcpy(VarPtr(buffer.Chars[i3]), _System_UsingStrData[ParmNum], SizeOf (Char) * i5)
 				i3 += i4
 			Else
@@ -416,7 +412,7 @@
 	RecodeNumber--
 
-	SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN)
+	SetFilePointer(_System_hFile(FileNumber), SizeOf (Char) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN)
 	Dim t = ZeroString(_System_FieldSize(FileNumber))
-	ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
+	ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (Char) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
 	If dwAccessByte = _System_FieldSize(FileNumber) Then
 		buffer = t.ToString
@@ -431,6 +427,6 @@
 	RecodeNumber--
 
-	SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN)
-	WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
+	SetFilePointer(_System_hFile(FileNumber), SizeOf (Char) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN)
+	WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (Char) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
 End Macro
 
@@ -444,5 +440,2 @@
 	DeleteFile(ToTCStr(path))
 End Macro
-
-
-#endif '_INC_COMMAND
Index: /trunk/Include/basic/dos_console.sbp
===================================================================
--- /trunk/Include/basic/dos_console.sbp	(revision 496)
+++ /trunk/Include/basic/dos_console.sbp	(revision 497)
@@ -30,5 +30,5 @@
 
 	'データを変数に格納
-	Const comma = &h2c As StrChar 'Asc(",")
+	Const comma = &h2c As Char 'Asc(",")
 	Dim broken = ActiveBasic.Strings.Detail.Split(input, comma)
 	Dim i As Long
Index: /trunk/Include/basic/function.sbp
===================================================================
--- /trunk/Include/basic/function.sbp	(revision 496)
+++ /trunk/Include/basic/function.sbp	(revision 497)
@@ -1,8 +1,3 @@
 'function.sbp
-
-
-#ifndef _INC_FUNCTION
-#define _INC_FUNCTION
-
 
 Const _System_PI = 3.14159265358979323846264
@@ -10,12 +5,4 @@
 Const _System_SQRT2 = 1.41421356237309504880168872421
 Const _System_Log_N = 7 As Long
-
-
-#require <Classes/System/Math.ab>
-#require <Classes/System/DateTime.ab>
-#require <Classes/System/Text/StringBuilder.ab>
-#require <Classes/ActiveBasic/Math/Math.ab>
-#require <Classes/ActiveBasic/Strings/Strings.ab>
-
 
 '------------- サポート関数の定義 -------------
@@ -243,13 +230,13 @@
 '------------
 
-Function Asc(buf As String) As StrChar
+Function Asc(buf As String) As Char
 	Asc = buf[0]
 End Function
 
-Function Chr$(code As StrChar) As String
+Function Chr$(code As Char) As String
 	Chr$ = New String(code, 1)
 End Function
 
-#ifndef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
 Function AscW(s As String) As UCSCHAR
 	If String.IsNullOrEmpty(s) Then
@@ -275,5 +262,5 @@
 Function ChrW(c As UCSCHAR) As String
 	If c <= &hFFFF Then
-		Return New String(c As StrChar, 1)
+		Return New String(c As Char, 1)
 	ElseIf c <= &h10FFFF Then
 		c -= &h10000
@@ -390,8 +377,8 @@
 
 Function Space$(length As Long) As String
-	Return New String(&h20 As StrChar, length)
-End Function
-
-Sub _ecvt_support(buf As *StrChar, count As Long, size As Long)
+	Return New String(&h20 As Char, length)
+End Function
+
+Sub _ecvt_support(buf As *Char, count As Long, size As Long)
 	Dim i As Long
 	If buf[count] = 9 Then
@@ -410,10 +397,10 @@
 End Sub
 
-Sub _ecvt(buffer As *StrChar, value As Double, count As Long, ByRef dec As Long, ByRef sign As Boolean)
+Sub _ecvt(buffer As *Char, value As Double, count As Long, ByRef dec As Long, ByRef sign As Boolean)
 	Dim i As Long, i2 As Long
 
 	'値が0の場合
 	If value = 0 Then
-		ActiveBasic.Strings.ChrFill(buffer, count As SIZE_T, &h30 As StrChar)
+		ActiveBasic.Strings.ChrFill(buffer, count As SIZE_T, &h30 As Char)
 		buffer[count] = 0
 		dec = 0
@@ -442,5 +429,5 @@
 
 	For i = 0 To count - 1
-		buffer[i] = Int(value) As StrChar
+		buffer[i] = Int(value) As Char
 		value = (value-CDbl(Int(value))) * 10
 	Next
@@ -471,5 +458,5 @@
 	End If
 	Dim dec As Long, sign As Boolean
-	Dim buffer[32] As StrChar, temp[15] As StrChar
+	Dim buffer[32] As Char, temp[15] As Char
 	Dim i = 0 As Long
 
@@ -585,8 +572,8 @@
 End Function
 
-Function String$(n As Long, s As StrChar) As String
+Function String$(n As Long, s As Char) As String
 	Return New String(s, n)
 End Function
-		
+
 #ifdef _AB4_COMPATIBILITY_STRING$_
 Function String$(n As Long, s As String) As String
@@ -594,8 +581,7 @@
 		'Throw ArgumentOutOfRangeException
 	End If
-
 	Dim buf = New System.Text.StringBuilder(s.Length * n)
 	Dim i As Long
-	For i = 0 To n
+	For i = 1 To n
 		buf.Append(s)
 	Next
@@ -603,9 +589,11 @@
 #else
 Function String$(n As Long, s As String) As String
+	Dim c As Char
 	If String.IsNullOrEmpty(s) Then
-		Return New String(0 As StrChar, n)
-	Else
-		Return New String(s[0], n)
-	End If
+		c = 0
+	Else
+		c = s[0]
+	End If
+	String$ = New String(c, n)
 End Function
 #endif
@@ -613,7 +601,5 @@
 Function Time$() As String
 	Dim time = System.DateTime.Now
-
 	Dim buf = New System.Text.StringBuilder(8)
-
 	'hour
 	If time.Hour < 10 Then
@@ -640,8 +626,8 @@
 End Function
 
-Function Val(buf As *StrChar) As Double
+Function Val(buf As *Char) As Double
 	Dim i As Long, i2 As Long, i3 As Long, i4 As Long
 	Dim temporary As String
-	Dim TempPtr As *StrChar
+	Dim TempPtr As *Char
 	Dim dbl As Double
 	Dim i64data As Int64
@@ -665,5 +651,5 @@
 				If Not (0<=i3 And i3<=7) Then Exit While
 
-				TempPtr[i]=i3 As StrChar
+				TempPtr[i]=i3 As Char
 				i++
 			Wend
@@ -688,5 +674,5 @@
 				End If
 
-				TempPtr[i]=i3 As StrChar
+				TempPtr[i]=i3 As Char
 				i++
 			Wend
@@ -703,8 +689,8 @@
 	Else
 		'10進数
-#ifdef __STRING_IS_NOT_UNICODE
+#ifdef UNICODE
+		swscanf(buf,"%lf",VarPtr(Val))
+#else
 		sscanf(buf,"%lf",VarPtr(Val))
-#else
-		swscanf(buf,ToWCStr("%lf"),VarPtr(Val))
 #endif
 	End If
@@ -981,5 +967,5 @@
 
 Function _System_IsLowSurrogate(c As WCHAR) As Boolean
-	Return &hDC00 <= c And c < &hE000 
+	Return &hDC00 <= c And c < &hE000
 End Function
 
@@ -1000,4 +986,2 @@
 	_System_GetHashFromWordArray = hash As Long
 End Function
-
-#endif '_INC_FUNCTION
Index: /trunk/Include/basic/prompt.sbp
===================================================================
--- /trunk/Include/basic/prompt.sbp	(revision 496)
+++ /trunk/Include/basic/prompt.sbp	(revision 497)
@@ -8,5 +8,5 @@
 Namespace Prompt
 Namespace Detail
-	
+
 Function _PromptSys_GetTextExtentPoint32(hdc As HDC, psz As PCSTR, cb As Long, ByRef Size As SIZE) As Long
 	_PromptSys_GetTextExtentPoint32 = GetTextExtentPoint32A(hdc, psz, cb, Size)
@@ -47,5 +47,5 @@
 Type _PromptSys_LineInformation
 	Length As Long
-	Text As *StrChar
+	Text As *Char
 	CharInfo As *_PromptSys_CharacterInformation
 End Type
@@ -53,5 +53,5 @@
 Dim _PromptSys_hFont As HFONT
 Dim _PromptSys_FontSize As SIZE
-Dim _PromptSys_InputStr[255] As StrChar
+Dim _PromptSys_InputStr[255] As Char
 Dim _PromptSys_InputLen = -1 As Long
 Dim _PromptSys_KeyChar As Byte
@@ -97,5 +97,5 @@
 		Next
 		_PromptSys_TextLine[100].Length = 0
-		_PromptSys_TextLine[100].Text = _System_calloc(SizeOf (StrChar) * 255)
+		_PromptSys_TextLine[100].Text = _System_calloc(SizeOf (Char) * 255)
 		_PromptSys_TextLine[100].CharInfo = _System_calloc(SizeOf (_PromptSys_CharacterInformation) * 255)
 		_PromptSys_CurPos.y--
@@ -136,5 +136,5 @@
 				End If
 				With _PromptSys_FontSize
-					_PromptSys_TextOut(hDC, currentLineCharInfo[i2].StartPos, i * .cy, VarPtr(_PromptSys_TextLine[i].Text[i2]) As *StrChar, tempLen)
+					_PromptSys_TextOut(hDC, currentLineCharInfo[i2].StartPos, i * .cy, VarPtr(_PromptSys_TextLine[i].Text[i2]) As *Char, tempLen)
 				End With
 				i2 += tempLen
@@ -191,5 +191,5 @@
 						EndIf
 						Dim p = buf.StrPtr
-						_PromptSys_GetTextExtentPoint32(hdc, VarPtr(p[i2]) As *StrChar, charLen, sz)
+						_PromptSys_GetTextExtentPoint32(hdc, VarPtr(p[i2]) As *Char, charLen, sz)
 						currentLineCharInfo[.x + 1].StartPos = currentLineCharInfo[.x].StartPos + sz.cx
 					End If
@@ -421,12 +421,9 @@
 		End If
 		Dim tempStr = Nothing As String
-		Dim str As *StrChar
-#ifdef __STRING_IS_NOT_UNICODE
-		Dim size = _PromptWnd_GetCompositionStringA(himc, str)
-		tempStr = New String(str, size As Long)
-#else
+		Dim str As *Char
+#ifdef UNICODE
 		Dim osver = System.Environment.OSVersion
 		With osver
-			' GetCompositionStringW is not implimented in Windows 95 
+			' GetCompositionStringW is not implimented in Windows 95
 			If .Version.Major = 4 And .Version.Minor = 0 And .Platform = System.PlatformID.Win32Windows Then
 				Dim strA As PCSTR
@@ -438,4 +435,7 @@
 			End If
 		End With
+#else
+		Dim size = _PromptWnd_GetCompositionStringA(himc, str)
+		tempStr = New String(str, size As Long)
 #endif
 		ImmReleaseContext(hwnd, himc)
@@ -460,5 +460,5 @@
 		With _PromptSys_TextLine[i]
 			.Length = 0
-			.Text = _System_calloc(SizeOf (StrChar) * 255)
+			.Text = _System_calloc(SizeOf (Char) * 255)
 			.CharInfo = _System_calloc(SizeOf (_PromptSys_CharacterInformation) * 255)
 		End With
@@ -543,5 +543,5 @@
 		For i = 0 To 100
 			With _PromptSys_TextLine[i]
-				.Text[0] = 0 '_System_FillChar(_PromptSys_TextLine[i].Text, -1 As StrChar, 0)
+				.Text[0] = 0 '_System_FillChar(_PromptSys_TextLine[i].Text, -1 As Char, 0)
 				.Length = 0
 			End With
@@ -589,5 +589,5 @@
 
 	'Set value to variable
-	Const comma = &h2c As StrChar 'Asc(",")
+	Const comma = &h2c As Char 'Asc(",")
 	Dim broken = ActiveBasic.Strings.Detail.Split(New String(_PromptSys_InputStr), comma)
 	Dim i As Long
@@ -617,5 +617,5 @@
 	Dim i = _PromptSys_TextLine[y].Length
 	If i < x Then
-		ActiveBasic.Strings.ChrFill(VarPtr(_PromptSys_TextLine[y].Text[i]), x - i, &h20 As StrChar) 'Asc(" ")
+		ActiveBasic.Strings.ChrFill(VarPtr(_PromptSys_TextLine[y].Text[i]), x - i, &h20 As Char) 'Asc(" ")
 		Dim i2 As Long
 		For i2 = i To ELM(x)
Index: /trunk/Include/com/index.ab
===================================================================
--- /trunk/Include/com/index.ab	(revision 496)
+++ /trunk/Include/com/index.ab	(revision 497)
@@ -1,4 +1,2 @@
-' com/index.ab
-
 #require <com/bstring.ab>
 #require <com/variant.ab>
Index: /trunk/Include/com/vbobject.ab
===================================================================
--- /trunk/Include/com/vbobject.ab	(revision 496)
+++ /trunk/Include/com/vbobject.ab	(revision 497)
@@ -1,8 +1,5 @@
 ' com/vbobject.ab
 
-#ifndef _COM_VBIBJECT_AB
-#define _COM_VBIBJECT_AB
-
-#include <com/variant.ab>
+#require <com/variant.ab>
 
 Namespace ActiveBasic
@@ -371,4 +368,2 @@
 End Namespace 'COM
 End Namespace 'ActiveBasic
-
-#endif '_COM_VBIBJECT_AB
Index: /trunk/Include/crt.sbp
===================================================================
--- /trunk/Include/crt.sbp	(revision 496)
+++ /trunk/Include/crt.sbp	(revision 497)
@@ -1,6 +1,3 @@
 'crt.sbp
-
-#ifndef _INC_CRT
-#define _INC_CRT
 
 #ifndef _DEFINE_CRTDLL_NAME
@@ -76,5 +73,2 @@
 Declare Function memcmp cdecl lib "msvcrt" (p1 As VoidPtr, p2 As VoidPtr, n As SIZE_T) As Long
 Declare Function wmemcmp cdecl lib "msvcrt" (p1 As *WCHAR, p2 As WCHAR, n As SIZE_T) As Long
-
-
-#endif '_INC_CRT
Index: /trunk/Include/directx9/d3d9caps.sbp
===================================================================
--- /trunk/Include/directx9/d3d9caps.sbp	(revision 496)
+++ /trunk/Include/directx9/d3d9caps.sbp	(revision 497)
@@ -1,8 +1,3 @@
 'd3d9caps.sbp
-
-
-#ifndef _INC_D3D9CAPS
-#define _INC_D3D9CAPS
-
 
 Type D3DVSHADERCAPS2_0
@@ -139,5 +134,5 @@
 	MaxVShaderInstructionsExecuted As DWord
 	MaxPShaderInstructionsExecuted As DWord
-	MaxVertexShader30InstructionSlots As DWord 
+	MaxVertexShader30InstructionSlots As DWord
 	MaxPixelShader30InstructionSlots As DWord
 End Type
@@ -163,5 +158,5 @@
 Const D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD = &H00000020
 
-' Indicates that the device can perform a gamma correction from 
+' Indicates that the device can perform a gamma correction from
 ' a windowed back buffer containing linear content to the sRGB desktop.
 Const D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION = &H00000080
@@ -246,5 +241,5 @@
 Const D3DPRASTERCAPS_SCISSORTEST         = &H01000000
 Const D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS = &H02000000
-Const D3DPRASTERCAPS_DEPTHBIAS           = &H04000000 
+Const D3DPRASTERCAPS_DEPTHBIAS           = &H04000000
 Const D3DPRASTERCAPS_MULTISAMPLE_TOGGLE  = &H08000000
 
@@ -395,5 +390,2 @@
 Const D3DDTCAPS_FLOAT16_2 = &H00000100
 Const D3DDTCAPS_FLOAT16_4 = &H00000200
-
-
-#endif '_INC_D3D9CAPS
Index: /trunk/Include/directx9/d3d9types.sbp
===================================================================
--- /trunk/Include/directx9/d3d9types.sbp	(revision 496)
+++ /trunk/Include/directx9/d3d9types.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' d3d9types.sbp
-
-
-#ifndef _INC_D3D9TYPES
-#define _INC_D3D9TYPES
-
 
 Const D3DCOLOR_ARGB(a,r,g,b) = ((a and &HFF)<<24) or ((r and &HFF)<<16) or ((g and &HFF)<<8) or (b and &HFF)
@@ -263,6 +258,6 @@
     D3DRS_FOGTABLEMODE              = 35   'D3DFOGMODE
     D3DRS_FOGSTART                  = 36   'Fog start (for both vertex and pixel fog)
-    D3DRS_FOGEND                    = 37   'Fog end     
-    D3DRS_FOGDENSITY                = 38   'Fog density 
+    D3DRS_FOGEND                    = 37   'Fog end
+    D3DRS_FOGDENSITY                = 38   'Fog density
     D3DRS_RANGEFOGENABLE            = 48   'Enables range-based fog
     D3DRS_STENCILENABLE             = 52   'BOOL enable/disable stenciling
@@ -983,5 +978,5 @@
 Const D3DLOCK_NOOVERWRITE     = &H00001000
 Const D3DLOCK_NOSYSLOCK       = &H00000800
-Const D3DLOCK_DONOTWAIT       = &H00004000                  
+Const D3DLOCK_DONOTWAIT       = &H00004000
 Const D3DLOCK_NO_DIRTY_UPDATE = &H00008000
 
@@ -1204,5 +1199,2 @@
 	PostTransformVertexCacheHitRate As Single
 End Type
-
-
-#endif '_INC_D3D9TYPES
Index: /trunk/Include/directx9/d3dx9.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9.sbp	(revision 497)
@@ -13,11 +13,11 @@
 Const D3DX_FROM_FILE       = -3
 
-#include <directx9\d3d9.sbp>
-#include <directx9\d3dx9math.sbp>
-#include <directx9\d3dx9core.sbp>
-#include <directx9\d3dx9xof.sbp>
-#include <directx9\d3dx9mesh.sbp>
-#include <directx9\d3dx9shader.sbp>
-#include <directx9\d3dx9tex.sbp>
+#require <directx9\d3d9.sbp>
+#require <directx9\d3dx9math.sbp>
+#require <directx9\d3dx9core.sbp>
+#require <directx9\d3dx9xof.sbp>
+#require <directx9\d3dx9mesh.sbp>
+#require <directx9\d3dx9shader.sbp>
+#require <directx9\d3dx9tex.sbp>
 
 
Index: /trunk/Include/directx9/d3dx9core.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9core.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9core.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' d3dx9core.sbp
-
-
-#ifndef _INC_D3DX9CORE
-#define _INC_D3DX9CORE
-
 
 Class ID3DXBuffer
@@ -214,5 +209,2 @@
 
 Declare Function D3DXCreateLine Lib "dx9abm" Alias "D3DXCreateLine_abm" (pDevice As LPDIRECT3DDEVICE9, ppLine As **ID3DXLine) As DWord
-
-
-#endif '_INC_D3DX9CORE
Index: /trunk/Include/directx9/d3dx9math.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9math.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9math.sbp	(revision 497)
@@ -1,8 +1,3 @@
 'd3dx9math.sbp
-
-
-#ifndef _INC_D3DX9MATH
-#define _INC_D3DX9MATH
-
 
 '---------------------------
@@ -36,5 +31,5 @@
 
 Type D3DXMATRIX
-    m[3,3] As Single
+	m[3,3] As Single
 End Type
 
@@ -265,5 +260,2 @@
 
 Declare Function D3DXCreateMatrixStack Lib "dx9abm" Alias "D3DXCreateMatrixStack_abm" (Flags As DWord, ppStack As **ID3DXMatrixStack) As DWord
-
-
-#endif '_INC_D3DX9MATH
Index: /trunk/Include/directx9/d3dx9mesh.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9mesh.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9mesh.sbp	(revision 497)
@@ -1,8 +1,3 @@
 'd3dx9mesh.sbp
-
-
-#ifndef _INC_D3DX9MESH
-#define _INC_D3DX9MESH
-
 
 ' patch mesh can be quads or tris
@@ -19,9 +14,9 @@
     D3DXMESH_32BIT                  = &H001  'If set, then use 32 bit indices, if not set use 16 bit indices.
 	D3DXMESH_DONOTCLIP              = &H002  'Use D3DUSAGE_DONOTCLIP for VB & IB.
-	D3DXMESH_POINTS                 = &H004  'Use D3DUSAGE_POINTS for VB & IB. 
-	D3DXMESH_RTPATCHES              = &H008  'Use D3DUSAGE_RTPATCHES for VB & IB. 
-	D3DXMESH_NPATCHES               = &H4000 'Use D3DUSAGE_NPATCHES for VB & IB. 
+	D3DXMESH_POINTS                 = &H004  'Use D3DUSAGE_POINTS for VB & IB.
+	D3DXMESH_RTPATCHES              = &H008  'Use D3DUSAGE_RTPATCHES for VB & IB.
+	D3DXMESH_NPATCHES               = &H4000 'Use D3DUSAGE_NPATCHES for VB & IB.
 	D3DXMESH_VB_SYSTEMMEM           = &H010  'Use D3DPOOL_SYSTEMMEM for VB. Overrides D3DXMESH_MANAGEDVERTEXBUFFER
-	D3DXMESH_VB_MANAGED             = &H020  'Use D3DPOOL_MANAGED for VB. 
+	D3DXMESH_VB_MANAGED             = &H020  'Use D3DPOOL_MANAGED for VB.
 	D3DXMESH_VB_WRITEONLY           = &H040  'Use D3DUSAGE_WRITEONLY for VB.
 	D3DXMESH_VB_DYNAMIC             = &H080  'Use D3DUSAGE_DYNAMIC for VB.
@@ -74,5 +69,5 @@
 
 Const Enum D3DXEFFECTDEFAULTTYPE
-    D3DXEDT_STRING = &H1       ' pValue points to a null terminated ASCII string 
+    D3DXEDT_STRING = &H1       ' pValue points to a null terminated ASCII string
     D3DXEDT_FLOATS = &H2       ' pValue points to an array of floats - number of floats is NumBytes / sizeof(float)
     D3DXEDT_DWORD  = &H3       ' pValue points to a DWORD
@@ -292,5 +287,5 @@
 	Abstract Function GetPatchInfo(PatchInfo As *D3DXPATCHINFO) As DWord
 
-	'Control mesh access    
+	'Control mesh access
 	Abstract Function GetVertexBuffer(ppVB As **IDirect3DVertexBuffer9) As DWord
 	Abstract Function GetIndexBuffer(ppIB As **IDirect3DIndexBuffer9) As DWord
@@ -336,5 +331,5 @@
 	'Set min bone influence. Bone influences that are smaller than this are ignored
 	Abstract Function SetMinBoneInfluence(MinInfl As Single) As DWord
-	'Get min bone influence. 
+	'Get min bone influence.
 	Abstract Function GetMinBoneInfluence() As Single
 
@@ -350,5 +345,5 @@
 	Abstract Function Clone(ppSkinInfo As **ID3DXSkinInfo) As DWord
 
-	'Update bone influence information to match vertices after they are reordered. This should be called 
+	'Update bone influence information to match vertices after they are reordered. This should be called
 	'if the target vertex buffer has been reordered externally.
 	Abstract Function Remap(NumVertices As DWord, pVertexRemap As DWordPtr) As DWord
@@ -367,5 +362,5 @@
 	Abstract Function ConvertToBlendedMesh(pMesh As *ID3DXMesh, Options As DWord, pAdjacencyIn As DWordPtr, pAdjacencyOut As DWordPtr, pFaceRemap As DWordPtr, ppVertexRemap As **ID3DXBuffer, pMaxFaceInfl As DWordPtr, pNumBoneCombinations As DWordPtr, ppBoneCombinationTable As **ID3DXBuffer, ppMesh As **ID3DXMesh) As DWord
 
-	'Takes a mesh and returns a new mesh with per vertex blend weights and indices 
+	'Takes a mesh and returns a new mesh with per vertex blend weights and indices
 	'and a bone combination table that describes which bones palettes affect which subsets of the mesh
 	Abstract Function ConvertToIndexedBlendedMesh(pMesh As *ID3DXMesh, Options As DWord, paletteSize As DWord, pAdjacencyIn As DWordPtr, pAdjacencyOut As DWordPtr, pFaceRemap As DWordPtr, ppVertexRemap As **ID3DXBuffer, pMaxVertexInfl As DWordPtr, pNumBoneCombinations As DWordPtr, ppBoneCombinationTable As **ID3DXBuffer, ppMesh As **ID3DXMesh) As DWord
@@ -430,5 +425,2 @@
 Declare Function D3DXOptimizeFaces Lib "dx9abm" Alias "D3DXOptimizeFaces_abm" (pbIndices As VoidPtr, cFaces As DWord, cVertices As DWord, b32BitIndices As Long, pFaceRemap As DWordPtr) As DWord
 Declare Function D3DXOptimizeVertices Lib "dx9abm" Alias "D3DXOptimizeVertices_abm" (pbIndices As VoidPtr, cFaces As DWord, cVertices As DWord, b32BitIndices As Long, pFaceRemap As DWordPtr) As DWord
-
-
-#endif '_INC_D3DX9MESH
Index: /trunk/Include/directx9/d3dx9shader.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9shader.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9shader.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' d3dx9shader.sbp
-
-
-#ifndef _INC_D3DX9SHADER
-#define _INC_D3DX9SHADER
-
 
 TypeDef D3DXHANDLE = BytePtr
@@ -217,5 +212,2 @@
 Declare Function D3DXCompileShaderFromResource Lib "dx9abm" Alias "D3DXCompileShaderFromResource_abm" (hSrcModule As HINSTANCE, pSrcResource As BytePtr, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, pFunctionName As BytePtr, pProfile As BytePtr, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER, ppConstantTable As *LPD3DXCONSTANTTABLE) As DWord
 Declare Function D3DXCompileShader Lib "dx9abm" Alias "D3DXCompileShader_abm" (pSrcData As BytePtr, SrcDataLen As DWord, pDefines As *D3DXMACRO, pInclude As LPD3DXINCLUDE, pFunctionName As BytePtr, pProfile As BytePtr, Flags As DWord, ppShader As *LPD3DXBUFFER, ppErrorMsgs As *LPD3DXBUFFER, ppConstantTable As *LPD3DXCONSTANTTABLE) As DWord
-
-
-#endif '_INC_D3DX9SHADER
Index: /trunk/Include/directx9/d3dx9tex.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9tex.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9tex.sbp	(revision 497)
@@ -1,8 +1,3 @@
 'd3dx9tex.sbp
-
-
-#ifndef _INC_D3DX9TEX
-#define _INC_D3DX9TEX
-
 
 ' D3DX_FILTER flags
@@ -143,6 +138,2 @@
 Declare Function D3DXFillVolumeTextureTX Lib "dx9abm" Alias "D3DXFillVolumeTextureTX_abm" (pVolumeTexture As LPDIRECT3DVOLUMETEXTURE9, pTextureShader As LPD3DXTEXTURESHADER) As DWord
 Declare Function D3DXComputeNormalMap Lib "dx9abm" Alias "D3DXComputeNormalMap_abm" (pTexture As LPDIRECT3DTEXTURE9, pSrcTexture As LPDIRECT3DTEXTURE9, pSrcPalette As *PALETTEENTRY, Flags As DWord, Channel As DWord, Amplitude As Single) As DWord
-
-
-#endif '_INC_D3DX9TEX
-
Index: /trunk/Include/directx9/d3dx9xof.sbp
===================================================================
--- /trunk/Include/directx9/d3dx9xof.sbp	(revision 496)
+++ /trunk/Include/directx9/d3dx9xof.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' d3dx9xof.sbp
-
-
-#ifndef _INC_D3DX9XOF
-#define _INC_D3DX9XOF
-
 
 Class ID3DXFile
@@ -64,5 +59,2 @@
 '未完成
 'Declare Function  Lib "dx9abm" Alias "_abm" () As DWord
-
-
-#endif '_INC_D3DX9XOF
Index: /trunk/Include/directx9/dmdls.sbp
===================================================================
--- /trunk/Include/directx9/dmdls.sbp	(revision 496)
+++ /trunk/Include/directx9/dmdls.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' dmdls.sbp - DLS download definitions for DirectMusic API's
-
-
-#ifndef _INC_DMDLS
-#define _INC_DMDLS
-
 
 Type DMUS_NOTERANGE
@@ -10,5 +5,2 @@
 	dwHighNote As DWord  'Sets the high note for the range of MIDI note events to which the instrument responds.
 End Type
-
-
-#endif '_INC_DMDLS
Index: /trunk/Include/directx9/dmplugin.sbp
===================================================================
--- /trunk/Include/directx9/dmplugin.sbp	(revision 496)
+++ /trunk/Include/directx9/dmplugin.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' dmplugin.sbp - This module contains the API for plugins for the DirectMusic performance layer
-
-
-#ifndef _INC_DMPLUGIN
-#define _INC_DMPLUGIN
-
 
 Class IDirectMusicTool
@@ -53,5 +48,5 @@
 	Abstract Function EndPlay(pStateData As VoidPtr) As DWord
 	Abstract Function Play(pStateData As VoidPtr, mtStart As MUSIC_TIME, mtEnd As MUSIC_TIME, mtOffset As MUSIC_TIME, dwFlags As DWord, pPerf As *IDirectMusicPerformance, pSegSt As *IDirectMusicSegmentState, dwVirtualID As DWord) As DWord
-	Abstract Function GetParam(ByRef rguidType As GUID, mtTime As MUSIC_TIME, pmtNext As *MUSIC_TIME, pParam As VoidPtr) As DWord 
+	Abstract Function GetParam(ByRef rguidType As GUID, mtTime As MUSIC_TIME, pmtNext As *MUSIC_TIME, pParam As VoidPtr) As DWord
 	Abstract Function SetParam(ByRef rguidType As GUID, mtTime As MUSIC_TIME, pParam As VoidPtr) As DWord
 	Abstract Function IsParamSupported(ByRef rguidType As GUID) As DWord
@@ -71,5 +66,2 @@
 	Abstract Function Join(pNewTrack As *IDirectMusicTrack, mtJoin As MUSIC_TIME, pContext As *IUnknown, dwTrackGroup As DWord, ppResultTrack As **IDirectMusicTrack) As DWord
 End Class
-
-
-#endif '_INC_DMPLUGIN
Index: /trunk/Include/directx9/dmusic.sbp
===================================================================
--- /trunk/Include/directx9/dmusic.sbp	(revision 496)
+++ /trunk/Include/directx9/dmusic.sbp	(revision 497)
@@ -6,8 +6,8 @@
 
 
-#include <directx9\dsound.sbp>
-#include <directx9\dmdls.sbp>
-#include <directx9\dmusicc.sbp>
-#include <directx9\dmplugin.sbp>
+#require <directx9\dsound.sbp>
+#require <directx9\dmdls.sbp>
+#require <directx9\dmusicc.sbp>
+#require <directx9\dmplugin.sbp>
 
 
Index: /trunk/Include/directx9/dmusicc.sbp
===================================================================
--- /trunk/Include/directx9/dmusicc.sbp	(revision 496)
+++ /trunk/Include/directx9/dmusicc.sbp	(revision 497)
@@ -1,8 +1,3 @@
 ' dmusicc.sbp - This module defines the DirectMusic core API's
-
-
-#ifndef _INC_DMUSICC
-#define _INC_DMUSICC
-
 
 Const DMUS_MAX_DESCRIPTION = 128
@@ -53,5 +48,5 @@
 	dwMemorySize As DWord
 	dwMaxChannelGroups As DWord
-	dwMaxVoices As DWord    
+	dwMaxVoices As DWord
 	dwMaxAudioChannels As DWord
 	dwEffectFlags As DWord
@@ -262,5 +257,2 @@
 Dim IID_IDirectMusicInstrument = [&Hd2ac287d, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
 Dim IID_IDirectMusicDownloadedInstrument = [&Hd2ac287e, &Hb39b, &H11d1, [&H87, &H4, &H0, &H60, &H8, &H93, &Hb1, &Hbd]] As GUID
-
-
-#endif '_INC_DMUSICC
Index: /trunk/Include/directx9/dsound.sbp
===================================================================
--- /trunk/Include/directx9/dsound.sbp	(revision 496)
+++ /trunk/Include/directx9/dsound.sbp	(revision 497)
@@ -1,9 +1,3 @@
 ' dsound.sbp
-
-
-#ifndef _INC_DSOUND
-#define _INC_DSOUND
-
-
 Const DIRECTSOUND_VERSION = &H0900
 
@@ -634,5 +628,2 @@
 ' Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C}
 Dim GUID_DSFX_WAVES_REVERB = [&H87fc0268, &H9a55, &H4360, [&H95, &Haa, &H00, &H4a, &H1d, &H9d, &He2, &H6c]] As GUID
-
-
-#endif '_INC_DSOUND
Index: /trunk/Include/gl/gl.sbp
===================================================================
--- /trunk/Include/gl/gl.sbp	(revision 496)
+++ /trunk/Include/gl/gl.sbp	(revision 497)
@@ -1,4 +1,3 @@
-#ifndef _INC_GL
-#define _INC_GL
+'gl/gl.sbp
 
 TypeDef GLenum = DWord
@@ -1018,4 +1017,2 @@
 TypeDef PFNGLGETCOLORTABLEPARAMETERIVEXTPROC = *Sub(target As GLenum, pname As GLenum, params As *GLint)
 TypeDef PFNGLGETCOLORTABLEPARAMETERFVEXTPROC = *Sub(target As GLenum, pname As GLenum, params As *GLfloat)
-
-#endif /* _INC_GL */
Index: /trunk/Include/gl/glu.sbp
===================================================================
--- /trunk/Include/gl/glu.sbp	(revision 496)
+++ /trunk/Include/gl/glu.sbp	(revision 497)
@@ -1,5 +1,2 @@
-#ifndef _INC_GLU
-#define _INC_GLU
-
 Function gluErrorStringWIN(errCode As GLenum) As PSTR
 	gluErrorStringWIN = gluErrorString(errCode) As PSTR
@@ -224,4 +221,2 @@
 Const GLU_ERROR = GLU_TESS_ERROR
 Const GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG
-
-#endif '_INC_GLU
Index: /trunk/Include/gl/glut.sbp
===================================================================
--- /trunk/Include/gl/glut.sbp	(revision 496)
+++ /trunk/Include/gl/glut.sbp	(revision 497)
@@ -1,8 +1,5 @@
-#ifndef _INC_GLUT
-#define _INC_GLUT
-
-#include <GL/gl.sbp>
-#include <GL/glu.sbp>
- 
+#require <GL/gl.sbp>
+#require <GL/glu.sbp>
+
 Const GLUT_XLIB_IMPLEMENTATION = 13
 
@@ -351,4 +348,2 @@
 Declare Sub glutLeaveGameMode Lib "glut32" ()
 Declare Function glutGameModeGet Lib "glut32" (mode As GLenum) As Long
-
-#endif '_INC_GLUT
Index: /trunk/Include/guiddef.ab
===================================================================
--- /trunk/Include/guiddef.ab	(revision 496)
+++ /trunk/Include/guiddef.ab	(revision 497)
@@ -30,7 +30,4 @@
 End Function
 
-#ifndef _SYS_GUID_OPERATOR_EQ_
-#ifdef _NO_SYS_GUID_OPERATOR_EQ_
-#define _SYS_GUID_OPERATOR_EQ_
 /*
 Function Operator ==(ByRef x As GUID, ByRef y As GUID) As Boolean
@@ -42,4 +39,2 @@
 End Function
 */
-#endif
-#endif
Index: /trunk/Include/objbase.sbp
===================================================================
--- /trunk/Include/objbase.sbp	(revision 496)
+++ /trunk/Include/objbase.sbp	(revision 497)
@@ -1,6 +1,3 @@
 ' objbase.sbp
-
-#ifndef _INC_OBJBASE
-#define _INC_OBJBASE
 
 TypeDef RPC_AUTH_IDENTITY_HANDLE = VoidPtr 'Declared in Rpcdce.sbp; include Rpc.sbp.
@@ -89,11 +86,10 @@
 Const CLSCTX_INPROC = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM)
-#ifdef _WIN32_DCOM
 Const CLSCTX_ALL    = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER
 Const CLSCTX_SERVER = CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER or CLSCTX_REMOTE_SERVER
-#else
-Const CLSCTX_ALL    = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or CLSCTX_LOCAL_SERVER
-Const CLSCTX_SERVER = CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER
-#endif
+'#else
+'Const CLSCTX_ALL    = CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER or CLSCTX_LOCAL_SERVER
+'Const CLSCTX_SERVER = CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER
+'#endif
 
 Const Enum REGCLS
@@ -115,5 +111,4 @@
 
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM)
-#ifdef _WIN32_DCOM
 Const Enum COINIT
 	COINIT_MULTITHREADED     = &h0
@@ -124,5 +119,5 @@
 Declare Function CoInitializeEx Lib "ole32" (pvReserved As VoidPtr, dwCoInit As DWord) As HRESULT
 Declare Function CoGetCallerTID Lib "ole32" (ByRef dwTID AS DWord) As HRESULT
-#endif
+'#endif
 
 #ifdef __UNDECLARED__
@@ -220,8 +215,8 @@
 
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM
-#ifdef _WIN32_DCOM
 
 /* Call Security. */
 
+/*SOLE_AUTHENTICATION_SERVICE未定義
 Declare Function CoInitializeSecurity Lib "ole32" (
 	ByVal pSecDesc As *SECURITY_DESCRIPTOR,
@@ -231,6 +226,7 @@
 	ByVal dwImpLevel As DWord,
 	ByVal pAuthList As VoidPtr,
-	ByVal dwCapabilities As DWord
+	ByVal dwCapabilities As DWord,
 	ByVal pReserved3 As VoidPtr) As HRESULT
+*/
 Declare Function CoGetCallContext Lib "ole32" (
 	ByRef riid As IID,
@@ -243,5 +239,5 @@
 	ByVal pAuthnLevel As *DWord,
 	ByVal pImpLevel As *DWord,
-	ByVal pAuthInfo As *RPC_AUTH_IDENTITY_HANDLE
+	ByVal pAuthInfo As *RPC_AUTH_IDENTITY_HANDLE,
 	ByVal pCapabilites As *DWord) As HRESULT
 Declare Function CoSetProxyBlanket Lib "ole32" (
@@ -263,5 +259,5 @@
 	ByVal pAuthnLevel As *DWord,
 	ByVal pImpLevel As *DWord,
-	ByVal pPrivs As *RPC_AUTHZ_HANDLE
+	ByVal pPrivs As *RPC_AUTHZ_HANDLE,
 	ByVal pCapabilities As *DWord) As HRESULT
 Declare Function CoImpersonateClient Lib "ole32" () As HRESULT
@@ -281,11 +277,9 @@
 Const COM_RIGHTS_ACTIVATE_LOCAL = 8
 Const COM_RIGHTS_ACTIVATE_REMOTE = 16
-
-#endif ' DCOM
+'#endif ' DCOM
 
 Declare Function CoCreateInstance Lib "ole32" (ByRef clsid As CLSID, pUnknown As *IUnknown, dwClsContext As DWord, ByRef refiid As IID, ByRef pObj As Any) As HRESULT
 
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM
-#ifdef _WIN32_DCOM
 Declare Function CoGetInstanceFromFile Lib "ole32" (
 	ByVal pServerInfo As *COSERVERINFO,
@@ -294,5 +288,5 @@
 	ByVal dwClsCtx As DWord,
 	ByVal grfMode As DWord,
-	ByVal pwszName As *OLECHAR
+	ByVal pwszName As *OLECHAR,
 	ByVal dwCount As DWord,
 	ByVal pResults As *MULTI_QI) As HRESULT
@@ -304,5 +298,5 @@
 	ByVal dwClsCtx As DWord,
 	ByVal grfMode As DWord,
-	ByVal pstg As *IStorage
+	ByVal pstg As *IStorage,
 	ByVal dwCount As DWord,
 	ByVal pResults As *MULTI_QI) As HRESULT
@@ -312,13 +306,11 @@
 	ByVal punkOuter As *IUnknown,
 	ByVal dwClsCtx As DWord,
-	ByVal pServerInfo As COSERVERINFO,
+	ByVal pServerInfo As *COSERVERINFO,
 	ByVal dwCount As DWord,
 	ByVal pResults As *MULTI_QI) As HRESULT
-#endif ' DCOM
+'#endif ' DCOM
 
 /* Call related APIs */
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM
-#ifdef _WIN32_DCOM
-
 Declare Function CoGetCancelObject Lib "ole32" (dwThreadId As DWord, ByRef iid As IID, ByRef pUnk As Any) As HRESULT
 Declare Function CoSetCancelObject Lib "ole32" (pUnk As *IUnknown) As HRESULT
@@ -329,6 +321,5 @@
 Declare Function CoAllowSetForegroundWindow Lib "ole32" (pUnk As *IUnknown, pvReserved As VoidPtr) As HRESULT
 Declare Function DcomChannelSetHResult Lib "ole32" (pvReserved As HRESULT, pulReserved As DWord, appsHR As HRESULT) As HRESULT
-
-#endif
+'#endif
 
 /* other helpers */
@@ -353,10 +344,9 @@
 
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM
-#ifdef _WIN32_DCOM
-Declare Function CoRegisterChannelHook Lib "ole32" (ByRef ExtensionUuid As GUID, pChannelHook As *IChannelHook) As HRESULT
-#endif ' DCOM
+'IChannelHook未定義
+'Declare Function CoRegisterChannelHook Lib "ole32" (ByRef ExtensionUuid As GUID, pChannelHook As *IChannelHook) As HRESULT
+'#endif ' DCOM
 
 '#if (_WIN32_WINNT >= &h0400) Or defined(_WIN32_DCOM) 'DCOM
-#ifdef _WIN32_DCOM
 
 Declare Function CoWaitForMultipleHandles Lib "ole32" (
@@ -375,5 +365,5 @@
 End Enum
 
-#endif ' DCOM
+'#endif ' DCOM
 
 /* for flushing OLESCM remote binding handles */
@@ -551,5 +541,2 @@
 	ByVal pIbscCaller As *IBindStatusCallback,
 	ByRef pIbsc As *IBindStatusCallback) As HRESULT
-
-
-#endif '_INC_OBJBASE
Index: /trunk/Include/objidl.sbp
===================================================================
--- /trunk/Include/objidl.sbp	(revision 496)
+++ /trunk/Include/objidl.sbp	(revision 497)
@@ -1,4 +1,3 @@
-#ifndef _INC_OBJIDL
-#define _INC_OBJIDL
+'Include/objidl.sbp
 
 TypeDef SNB = **OLECHAR
@@ -132,5 +131,5 @@
 
 /* interface IExternalConnection */
-/* [uuid][local][object] */ 
+/* [uuid][local][object] */
 
 Const Enum EXTCONN
@@ -144,9 +143,9 @@
 Interface IExternalConnection
 	Inherits IUnknown
-    
+
 	Function AddConnection(
 		/* [in] */ extconn As DWord,
 		/* [in] */ reserved As DWord) As DWord
-	Function ReleaseConnection( 
+	Function ReleaseConnection(
 		/* [in] */ extconn As DWord,
 		/* [in] */ reserved As DWord,
@@ -170,5 +169,5 @@
 
 /* interface AsyncIMultiQI */
-/* [uuid][local][object] */ 
+/* [uuid][local][object] */
 
 
@@ -185,5 +184,5 @@
 
 /* interface IInternalUnknown */
-/* [uuid][local][object] */ 
+/* [uuid][local][object] */
 Dim IID_IInternalUnknown = [&h00000021, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
 Interface IInternalUnknown
@@ -539,6 +538,4 @@
 End Interface
 
-TypeDef LPSTREAM = *IStream
-
 /* interface IEnumSTATSTG */
 /* [unique][uuid][object] */
@@ -561,6 +558,4 @@
 /* interface IStorage */
 /* [unique][uuid][object] */
-
-TypeDef LPSTORAGE = /* [unique] */ *IStorage
 
 Type RemSNB
@@ -989,5 +984,5 @@
 
 Dim IID_IGlobalInterfaceTable = [&h00000146, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
-Interface IGlobalInterfaceTable 
+Interface IGlobalInterfaceTable
 	Inherits IUnknown
 
@@ -1067,4 +1062,2 @@
 
 ' IInitializeSpy
-
-#endif '_INC_OBJIDL
Index: /trunk/Include/ole2.ab
===================================================================
--- /trunk/Include/ole2.ab	(revision 496)
+++ /trunk/Include/ole2.ab	(revision 497)
@@ -1,5 +1,2 @@
-#ifndef __OLE2_AB__
-#define __OLE2_AB__
-
 ' 暫定措置
 
@@ -309,3 +306,2 @@
 Declare Function OleLoadPicture Lib "olepro32" (stream As IStream, lSize As Long, fRunmode As BOOL, ByRef riid As IID, ppvObj As VoidPtr) As HRESULT
 #endif '__UNDEFINED
-#endif ' __OLE2_AB__
Index: /trunk/Include/qos.ab
===================================================================
--- /trunk/Include/qos.ab	(revision 496)
+++ /trunk/Include/qos.ab	(revision 497)
@@ -1,5 +1,3 @@
 ' qos.ab
-#ifndef _INC_QOS_AB
-#define _INC_QOS_AB
 
 ' Definitions for valued-based Service Type for each direction of data flow.
@@ -76,4 +74,2 @@
 End Type
 TypeDef LPQOS_SHAPING_RATE = *QOS_SHAPING_RATE
-
-#endif '_INC_QOS_AB
Index: /trunk/Include/system/string.sbp
===================================================================
--- /trunk/Include/system/string.sbp	(revision 496)
+++ /trunk/Include/system/string.sbp	(revision 497)
@@ -1,7 +1,4 @@
 'string.sbp
 '文字列変数の操作用
-
-#ifndef _INC_BASIC_STRING
-#define _INC_BASIC_STRING
 
 Function StrPtr(s As String) As *Char
@@ -319,8 +316,6 @@
 
 #ifndef UNICODE
-Typedef BoxedStrChar = System.SByte
+TypeDef BoxedStrChar = System.SByte
 #else
 TypeDef BoxedStrChar = System.UInt16
 #endif
-
-#endif '_INC_BASIC_STRING
Index: /trunk/Include/unknwn.sbp
===================================================================
--- /trunk/Include/unknwn.sbp	(revision 496)
+++ /trunk/Include/unknwn.sbp	(revision 497)
@@ -1,7 +1,4 @@
 ' unknwn.sbp
 ' 本来はunknwn.idlから生成するのが正当ですが、これは手動で移植したものです。
-
-#ifndef _INC_UNKNWN
-#define _INC_UNKNWN
 
 '-------------------
@@ -17,5 +14,4 @@
 	Function Release() As DWord
 End Interface
-TypeDef LPUNKNOWN = *IUnknown
 
 Dim IID_AsyncIUnknown = [&H000e0000, &H0000, &H0000, [&HC0, &H00, &H00, &H00, &H00, &H00, &H00, &H46]] As IID
@@ -37,7 +33,5 @@
 	Inherits IUnknown
 
-	Function CreateInstance(ByVal pUnkOuter As *IUnknown, ByRef riid As IID, ByRef ppvObject As Any) As HRESULT
+	Function CreateInstance(ByVal unkOuter As IUnknown, ByRef riid As IID, ByRef ppvObject As Any) As HRESULT
 	Function LockServer(ByVal fLock As BOOL) As HRESULT
 End Interface
-
-#endif '_INC_UNKNWN
Index: /trunk/Include/windef.ab
===================================================================
--- /trunk/Include/windef.ab	(revision 496)
+++ /trunk/Include/windef.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' windef.ab
-
-#ifndef _WINDEF_
-#define _WINDEF_
 
 '#ifndef WINVER
@@ -8,6 +5,4 @@
 '#endif
 
-#ifndef BASETYPES
-#define BASETYPES
 'TypeDef ULONG = DWord
 'TypeDef PULONG = *ULONG
@@ -17,22 +12,11 @@
 TypeDef PUCHAR = *UCHAR
 'TypeDef PSZ = *SByte
-#endif
 
 Const MAX_PATH = 260
 
-'#ifndef NULL
-'#define NULL
 Const NULL = 0 As VoidPtr
-'#endif
-
-'#ifndef FALSE
-'#define FALSE
+
 Const FALSE = 0
-'#endif
-
-'#ifndef TRUE
-'#define TRUE
 Const TRUE = 1
-'#endif
 
 TypeDef DWORD = DWord
@@ -60,7 +44,5 @@
 'TypeDef PUINT = *DWord
 
-#ifndef NT_INCLUDED
 #require <winnt.ab>
-#endif
 
 '#require <specstrings.ab>
@@ -88,14 +70,10 @@
 Const LOWORD(dw) = ((dw As DWord) And &HFFFF) As Word
 
-#ifndef WIN_INTERNAL
 Type _System_DeclareHandle_HWND:unused As DWord:End Type
 TypeDef HWND = *_System_DeclareHandle_HWND
 Type _System_DeclareHandle_HHOOK:unused As DWord:End Type
 TypeDef HHOOK = *_System_DeclareHandle_HHOOK
-#ifdef WINABLE
-Type _System_DeclareHandleHEVENT:unused As DWord:End Type
+Type _System_DeclareHandle_HEVENT:unused As DWord:End Type
 TypeDef HEVENT = *_System_DeclareHandle_HEVENT
-#endif
-#endif
 
 TypeDef ATOM = Word
@@ -117,20 +95,14 @@
 TypeDef PHKEY = *HKEY
 
-#ifndef WIN_INTERNAL
 Type _System_DeclareHandle_HACCEL:unused As DWord:End Type
 TypeDef HACCEL = *_System_DeclareHandle_HACCEL
-#endif
-#ifndef GDI_INTERNAL
 Type _System_DeclareHandle_HBITMAP:unused As DWord:End Type
 TypeDef HBITMAP = *_System_DeclareHandle_HBITMAP
 Type _System_DeclareHandle_HBRUSH:unused As DWord:End Type
 TypeDef HBRUSH = *_System_DeclareHandle_HBRUSH
-#endif
 Type _System_DeclareHandle_HCOLORSPACE:unused As DWord:End Type
 TypeDef HCOLORSPACE = *_System_DeclareHandle_HCOLORSPACE
-#ifndef GDI_INTERNAL
 Type _System_DeclareHandle_HDC:unused As DWord:End Type
 TypeDef HDC = *_System_DeclareHandle_HDC
-#endif
 Type _System_DeclareHandle_HGLRC:unused As DWord:End Type
 TypeDef HGLRC = *_System_DeclareHandle_HGLRC
@@ -139,14 +111,10 @@
 Type _System_DeclareHandle_HENHMETAFILE:unused As DWord:End Type
 TypeDef HENHMETAFILE = *_System_DeclareHandle_HENHMETAFILE
-#ifndef GDI_INTERNAL
 Type _System_DeclareHandle_HFONT:unused As DWord:End Type
 TypeDef HFONT = *_System_DeclareHandle_HFONT
-#endif
 Type _System_DeclareHandle_HICON:unused As DWord:End Type
 TypeDef HICON = *_System_DeclareHandle_HICON
-#ifndef WIN_INTERNAL
 Type _System_DeclareHandle_HMENU:unused As DWord:End Type
 TypeDef HMENU = *_System_DeclareHandle_HMENU
-#endif
 Type _System_DeclareHandle_HMETAFILE:unused As DWord:End Type
 TypeDef HMETAFILE = *_System_DeclareHandle_HMETAFILE
@@ -154,10 +122,8 @@
 TypeDef HINSTANCE = *_System_DeclareHandle_HINSTANCE
 TypeDef HMODULE = HINSTANCE
-#ifndef GDI_INTERNAL
 Type _System_DeclareHandle_HPALETTE:unused As DWord:End Type
 TypeDef HPALETTE = *_System_DeclareHandle_HPALETTE
 Type _System_DeclareHandle_HPEN:unused As DWord:End Type
 TypeDef HPEN = *_System_DeclareHandle_HPEN
-#endif
 Type _System_DeclareHandle_HRGN:unused As DWord:End Type
 TypeDef HRGN = *_System_DeclareHandle_HRGN
@@ -249,6 +215,4 @@
 TypeDef PFILETIME = *FILETIME
 TypeDef LPFILETIME = *FILETIME
-
-#define _FILETIME_
 
 Const DM_UPDATE = 1
@@ -280,4 +244,2 @@
 Const DC_ORIENTATION = 17
 Const DC_COPIES = 18
-
-#endif
Index: /trunk/Include/windows.sbp
===================================================================
--- /trunk/Include/windows.sbp	(revision 496)
+++ /trunk/Include/windows.sbp	(revision 497)
@@ -1,7 +1,3 @@
 ' Windows.sbp - declarations file for Windows API.
-
-
-#ifndef _INC_WINDOWS
-#define _INC_WINDOWS
 
 TypeDef OLECHAR = WCHAR
@@ -48,4 +44,2 @@
 Const GET_X_LPARAM(lp) = ((LOWORD(lp) As Integer) As Long)
 Const GET_Y_LPARAM(lp) = ((HIWORD(lp) As Integer) As Long)
-
-#endif '_INC_WINDOWS
Index: /trunk/Include/winver.ab
===================================================================
--- /trunk/Include/winver.ab	(revision 496)
+++ /trunk/Include/winver.ab	(revision 497)
@@ -1,6 +1,3 @@
 ' Winver.ab
-
-#ifndef __WINVER_AB
-#define __WINVER_AB
 
 #ifdef UNICODE
@@ -210,4 +207,2 @@
 	ByRef uLen As DWord _
 ) As BOOL
-
-#endif '__WINVER_AB
