source: Include/basic.sbp@ 145

Last change on this file since 145 was 142, checked in by イグトランス (egtra), 18 years ago

Environment, OperatingSystem, Versionの追加、Unicode対応修正ほか

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