Skip to content

Commit ead45ab

Browse files
committed
Fix 64-bit compilation issues
- Update VBA-JSON to v1.0.2 - Small changes to compiler directives Closes #98
1 parent 8faf826 commit ead45ab

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

src/WebHelpers.bas

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Const AUTOPROXY_CONFIG_URL = 2
131131
Const AUTOPROXY_DETECT_TYPE_DHCP = 1
132132
Const AUTOPROXY_DETECT_TYPE_DNS = 2
133133
#End If
134-
' ===
134+
' === End AutoProxy
135135

136136
' === VBA-JSON Headers
137137
' === VBA-UTC Headers
@@ -142,35 +142,37 @@ Private Declare Function utc_pclose Lib "libc.dylib" Alias "pclose" (ByVal utc_F
142142
Private Declare Function utc_fread Lib "libc.dylib" Alias "fread" (ByVal utc_Buffer As String, ByVal utc_Size As Long, ByVal utc_Number As Long, ByVal utc_File As Long) As Long
143143
Private Declare Function utc_feof Lib "libc.dylib" Alias "feof" (ByVal utc_File As Long) As Long
144144

145-
Private Type utc_ShellResult
146-
utc_Output As String
147-
utc_ExitCode As Long
148-
End Type
149-
150-
#ElseIf Win32 Then
145+
#ElseIf VBA7 Then
151146

152147
' http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421.aspx
153148
' http://msdn.microsoft.com/en-us/library/windows/desktop/ms724949.aspx
154149
' http://msdn.microsoft.com/en-us/library/windows/desktop/ms725485.aspx
155-
Private Declare Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _
150+
Private Declare PtrSafe Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _
156151
(utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION) As Long
157-
Private Declare Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _
152+
Private Declare PtrSafe Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _
158153
(utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpUniversalTime As utc_SYSTEMTIME, utc_lpLocalTime As utc_SYSTEMTIME) As Long
159-
Private Declare Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _
154+
Private Declare PtrSafe Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _
160155
(utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpLocalTime As utc_SYSTEMTIME, utc_lpUniversalTime As utc_SYSTEMTIME) As Long
161156

162157
#Else
163158

164-
Private Declare PtrSafe Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _
159+
Private Declare Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _
165160
(utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION) As Long
166-
Private Declare PtrSafe Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _
161+
Private Declare Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _
167162
(utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpUniversalTime As utc_SYSTEMTIME, utc_lpLocalTime As utc_SYSTEMTIME) As Long
168-
Private Declare PtrSafe Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _
163+
Private Declare Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _
169164
(utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpLocalTime As utc_SYSTEMTIME, utc_lpUniversalTime As utc_SYSTEMTIME) As Long
170165

171166
#End If
172167

173-
#If Win32 Or Win64 Then
168+
#If Mac Then
169+
170+
Private Type utc_ShellResult
171+
utc_Output As String
172+
utc_ExitCode As Long
173+
End Type
174+
175+
#Else
174176

175177
Private Type utc_SYSTEMTIME
176178
utc_wYear As Integer
@@ -194,17 +196,21 @@ Private Type utc_TIME_ZONE_INFORMATION
194196
End Type
195197

196198
#End If
197-
' ===
199+
' === End VBA-UTC
198200

199201
#If Mac Then
200-
#ElseIf Win64 Then
202+
#ElseIf VBA7 Then
203+
201204
Private Declare PtrSafe Sub json_CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
202205
(json_MemoryDestination As Any, json_MemorySource As Any, ByVal json_ByteLength As Long)
206+
203207
#Else
208+
204209
Private Declare Sub json_CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
205210
(json_MemoryDestination As Any, json_MemorySource As Any, ByVal json_ByteLength As Long)
211+
206212
#End If
207-
' ===
213+
' === End VBA-JSON
208214

209215
#If Mac Then
210216
Private Declare Function web_popen Lib "libc.dylib" Alias "popen" (ByVal Command As String, ByVal mode As String) As Long
@@ -1683,7 +1689,8 @@ Public Function StringToAnsiBytes(web_Text As String) As Byte()
16831689
StringToAnsiBytes = web_AnsiBytes
16841690
End Function
16851691

1686-
#If Win32 Or Win64 Then
1692+
#If Mac Then
1693+
#Else
16871694
Private Function web_AnsiBytesToBase64(web_Bytes() As Byte)
16881695
' Use XML to convert to Base64
16891696
Dim web_XmlObj As Object
@@ -1728,7 +1735,7 @@ Private Function web_GetUrlEncodedKeyValue(Key As Variant, Value As Variant) As
17281735
End Function
17291736

17301737
''
1731-
' VBA-JSON v1.0.1
1738+
' VBA-JSON v1.0.2
17321739
' (c) Tim Hall - https://github.com/VBA-tools/VBA-JSON
17331740
'
17341741
' JSON Converter for VBA
@@ -2335,7 +2342,7 @@ Private Function json_BufferToString(ByRef json_buffer As String, ByVal json_Buf
23352342
#End If
23362343
End Function
23372344

2338-
#If Win64 Then
2345+
#If VBA7 Then
23392346
Private Function json_UnsignedAdd(json_Start As LongPtr, json_Increment As Long) As LongPtr
23402347
#Else
23412348
Private Function json_UnsignedAdd(json_Start As Long, json_Increment As Long) As Long
@@ -2351,7 +2358,7 @@ Private Function json_UnsignedAdd(json_Start As Long, json_Increment As Long) As
23512358
End Function
23522359

23532360
''
2354-
' VBA-UTC v1.0.0
2361+
' VBA-UTC v1.0.1
23552362
' (c) Tim Hall - https://github.com/VBA-tools/VBA-UtcConverter
23562363
'
23572364
' UTC/ISO 8601 Converter for VBA

0 commit comments

Comments
 (0)