source: Include/basic.sbp@ 111

Last change on this file since 111 was 79, checked in by dai, 18 years ago

Booleanがコンパイラで実装されたので、TypeDefを削除。
DLLコンパイル時にGCの破棄部分が正常に働かないバグを修正。
TraceListener周りを修正。

File size: 2.4 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' Boolena型の定数
38Const True = 1 As Boolean
39Const False = 0 As Boolean
40
41
42
43'------------------
44' Types of pointer
45'------------------
46TypeDef BytePtr = *Byte
47TypeDef WordPtr = *Word
48TypeDef DWordPtr = *DWord
49TypeDef SinglePtr = *Single
50TypeDef DoublePtr = *Double
51
52#ifdef _WIN64
53TypeDef LONG_PTR = Int64
54TypeDef ULONG_PTR = QWord
55TypeDef HALF_PTR = Long
56TypeDef UHALF_PTR = DWord
57#else
58TypeDef LONG_PTR = Long
59TypeDef ULONG_PTR = DWord
60TypeDef HALF_PTR = Integer
61TypeDef UHALF_PTR = Word
62#endif
63TypeDef DWORD_PTR = ULONG_PTR
64
65Sub Set_LONG_PTR(pPtr As VoidPtr, lpData As LONG_PTR)
66#ifdef _WIN64
67 SetQWord(pPtr,lpData)
68#else
69 SetDWord(pPtr,lpData)
70#endif
71End Sub
72
73Function Get_LONG_PTR(pPtr As VoidPtr) As LONG_PTR
74#ifdef _WIN64
75 Get_LONG_PTR = GetQWord(pPtr)
76#else
77 Get_LONG_PTR = GetDWord(pPtr)
78#endif
79End Function
80
81TypeDef SIZE_T = ULONG_PTR
82TypeDef SSIZE_T = LONG_PTR
83
84TypeDef WCHAR = Word
85
86'--------------------------
87' Specify elements number
88'--------------------------
89Const ELM(n) = n - 1
90
91#include <windows.sbp>
92#include <crt.sbp>
93#include <objbase.sbp>
94
95
96Sub _System_GetEip() 'dummy
97End Sub
98
99
100Dim _System_CriticalSection As CRITICAL_SECTION
101Dim _System_hProcessHeap As HANDLE
102
103Sub _System_StartupProgram()
104 'この関数はアプリケーションの起動時にシステムからコールバックされます
105
106 InitializeCriticalSection(_System_CriticalSection)
107
108 _System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
109
110 _System_GC._System_CGarbageCollection()
111
112 'Initialize global variables
113 _System_InitDllGlobalVariables()
114
115 'Initialize static variables
116 _System_InitStaticLocalVariables()
117End Sub
118
119Sub _System_EndProgram()
120 DeleteCriticalSection(_System_CriticalSection)
121End Sub
122
123
124
125#include <system\string.sbp>
126#include <system\debug.sbp>
127#include <system\gc.sbp>
128#include <system\enum.sbp>
129#include <system\exception.ab>
130
131#include <Classes\index.ab>
132
133
134#include <basic\function.sbp>
135#include <basic\command.sbp>
136
137
138#endif '_INC_BASIC
Note: See TracBrowser for help on using the repository browser.