source: Include/basic.sbp@ 71

Last change on this file since 71 was 71, checked in by dai, 17 years ago

仮のBoolean型を1バイトに調整。

File size: 2.6 KB
Line 
1'basic.sbp
2
3
4#ifndef _INC_BASIC
5#define _INC_BASIC
6
7
8Sub _System_InitDllGlobalVariables() 'dummy
9End Sub
10
11
12Const LONG_MAX = &H7FFFFFFF
13Const LONG_MIN = &H80000000
14
15Const FLT_MAX = 3.402823466e+38
16Const FLT_MIN = 1.175494351e-38
17
18'-------------
19' Basic Types
20'-------------
21
22'Char
23'Byte
24'Integer
25'Word
26'Long
27TypeDef Int32 = Long
28'DWord
29'Int64
30'QWord
31'Single
32'Double
33
34TypeDef BOOL = Long
35
36
37'--------------------------------------------------------------------
38' Boolena型の暫定対応
39' ※コンパイラが実装するまではこちらを使いましょう。
40TypeDef Boolean = Byte
41Const True = 1
42Const False = 0
43'--------------------------------------------------------------------
44
45
46
47'------------------
48' Types of pointer
49'------------------
50TypeDef BytePtr = *Byte
51TypeDef WordPtr = *Word
52TypeDef DWordPtr = *DWord
53TypeDef SinglePtr = *Single
54TypeDef DoublePtr = *Double
55
56#ifdef _WIN64
57TypeDef LONG_PTR = Int64
58TypeDef ULONG_PTR = QWord
59TypeDef HALF_PTR = Long
60TypeDef UHALF_PTR = DWord
61#else
62TypeDef LONG_PTR = Long
63TypeDef ULONG_PTR = DWord
64TypeDef HALF_PTR = Integer
65TypeDef UHALF_PTR = Word
66#endif
67TypeDef DWORD_PTR = ULONG_PTR
68
69Sub Set_LONG_PTR(pPtr As VoidPtr, lpData As LONG_PTR)
70#ifdef _WIN64
71 SetQWord(pPtr,lpData)
72#else
73 SetDWord(pPtr,lpData)
74#endif
75End Sub
76
77Function Get_LONG_PTR(pPtr As VoidPtr) As LONG_PTR
78#ifdef _WIN64
79 Get_LONG_PTR = GetQWord(pPtr)
80#else
81 Get_LONG_PTR = GetDWord(pPtr)
82#endif
83End Function
84
85TypeDef SIZE_T = ULONG_PTR
86TypeDef SSIZE_T = LONG_PTR
87
88TypeDef WCHAR = Word
89
90'--------------------------
91' Specify elements number
92'--------------------------
93Const ELM(n) = n - 1
94
95#include <windows.sbp>
96#include <crt.sbp>
97#include <objbase.sbp>
98
99
100Sub _System_GetEip() 'dummy
101End Sub
102
103
104Dim _System_CriticalSection As CRITICAL_SECTION
105Dim _System_hProcessHeap As HANDLE
106
107Sub _System_StartupProgram()
108 'この関数はアプリケーションの起動時にシステムからコールバックされます
109
110 InitializeCriticalSection(_System_CriticalSection)
111
112 _System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
113
114 _System_GC._System_CGarbageCollection()
115
116 'Initialize global variables
117 _System_InitDllGlobalVariables()
118
119 'Initialize static variables
120 _System_InitStaticLocalVariables()
121End Sub
122
123Sub _System_EndProgram()
124 DeleteCriticalSection(_System_CriticalSection)
125End Sub
126
127
128
129#include <system\string.sbp>
130#include <system\debug.sbp>
131#include <system\gc.sbp>
132#include <system\enum.sbp>
133#include <system\exception.ab>
134
135#include <Classes\index.ab>
136
137
138#include <basic\function.sbp>
139#include <basic\command.sbp>
140
141
142#endif '_INC_BASIC
Note: See TracBrowser for help on using the repository browser.