source: Include/basic.sbp@ 121

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

#51対応

File size: 2.5 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
81Sub SetChar(p As *Char, c As Char)
82 p[0] = c
83End Sub
84
85Function GetChar(p As *Char) As Char
86 GetChar = p[0]
87End Function
88
89TypeDef SIZE_T = ULONG_PTR
90TypeDef SSIZE_T = LONG_PTR
91
92TypeDef WCHAR = Word
93
94'--------------------------
95' Specify elements number
96'--------------------------
97Const ELM(n) = (n - 1)
98
99#include <windows.sbp>
100#include <crt.sbp>
101#include <objbase.sbp>
102
103
104Sub _System_GetEip() 'dummy
105End Sub
106
107
108Dim _System_CriticalSection As CRITICAL_SECTION
109Dim _System_hProcessHeap As HANDLE
110
111Sub _System_StartupProgram()
112 'この関数はアプリケーションの起動時にシステムからコールバックされます
113
114 InitializeCriticalSection(_System_CriticalSection)
115
116 _System_hProcessHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0)
117
118 _System_GC._System_CGarbageCollection()
119
120 'Initialize global variables
121 _System_InitDllGlobalVariables()
122
123 'Initialize static variables
124 _System_InitStaticLocalVariables()
125End Sub
126
127Sub _System_EndProgram()
128 DeleteCriticalSection(_System_CriticalSection)
129End Sub
130
131
132
133#include <system\string.sbp>
134#include <system\debug.sbp>
135#include <system\gc.sbp>
136#include <system\enum.sbp>
137#include <system\exception.ab>
138
139#include <Classes\index.ab>
140
141
142#include <basic\function.sbp>
143#include <basic\command.sbp>
144
145
146#endif '_INC_BASIC
Note: See TracBrowser for help on using the repository browser.