diff --git a/JsonConverter.bas b/JsonConverter.bas index 60fc195..02f7ed4 100644 --- a/JsonConverter.bas +++ b/JsonConverter.bas @@ -52,35 +52,37 @@ Private Declare Function utc_pclose Lib "libc.dylib" Alias "pclose" (ByVal utc_F 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 Private Declare Function utc_feof Lib "libc.dylib" Alias "feof" (ByVal utc_File As Long) As Long -Private Type utc_ShellResult - utc_Output As String - utc_ExitCode As Long -End Type - -#ElseIf Win32 Then +#ElseIf VBA7 Then ' http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421.aspx ' http://msdn.microsoft.com/en-us/library/windows/desktop/ms724949.aspx ' http://msdn.microsoft.com/en-us/library/windows/desktop/ms725485.aspx -Private Declare Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _ +Private Declare PtrSafe Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _ (utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION) As Long -Private Declare Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _ +Private Declare PtrSafe Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _ (utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpUniversalTime As utc_SYSTEMTIME, utc_lpLocalTime As utc_SYSTEMTIME) As Long -Private Declare Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _ +Private Declare PtrSafe Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _ (utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpLocalTime As utc_SYSTEMTIME, utc_lpUniversalTime As utc_SYSTEMTIME) As Long #Else -Private Declare PtrSafe Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _ +Private Declare Function utc_GetTimeZoneInformation Lib "kernel32" Alias "GetTimeZoneInformation" _ (utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION) As Long -Private Declare PtrSafe Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _ +Private Declare Function utc_SystemTimeToTzSpecificLocalTime Lib "kernel32" Alias "SystemTimeToTzSpecificLocalTime" _ (utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpUniversalTime As utc_SYSTEMTIME, utc_lpLocalTime As utc_SYSTEMTIME) As Long -Private Declare PtrSafe Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _ +Private Declare Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alias "TzSpecificLocalTimeToSystemTime" _ (utc_lpTimeZoneInformation As utc_TIME_ZONE_INFORMATION, utc_lpLocalTime As utc_SYSTEMTIME, utc_lpUniversalTime As utc_SYSTEMTIME) As Long #End If -#If Win32 Or Win64 Then +#If Mac Then + +Private Type utc_ShellResult + utc_Output As String + utc_ExitCode As Long +End Type + +#Else Private Type utc_SYSTEMTIME utc_wYear As Integer @@ -104,15 +106,19 @@ Private Type utc_TIME_ZONE_INFORMATION End Type #End If -' === +' === End VBA-UTC #If Mac Then -#ElseIf Win64 Then +#ElseIf VBA7 Then + Private Declare PtrSafe Sub json_CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _ (json_MemoryDestination As Any, json_MemorySource As Any, ByVal json_ByteLength As Long) + #Else + Private Declare Sub json_CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _ (json_MemoryDestination As Any, json_MemorySource As Any, ByVal json_ByteLength As Long) + #End If ' ============================================= ' @@ -676,7 +682,7 @@ Private Function json_BufferToString(ByRef json_buffer As String, ByVal json_Buf #End If End Function -#If Win64 Then +#If VBA7 Then Private Function json_UnsignedAdd(json_Start As LongPtr, json_Increment As Long) As LongPtr #Else Private Function json_UnsignedAdd(json_Start As Long, json_Increment As Long) As Long @@ -692,7 +698,7 @@ Private Function json_UnsignedAdd(json_Start As Long, json_Increment As Long) As End Function '' -' VBA-UTC v1.0.0 +' VBA-UTC v1.0.1 ' (c) Tim Hall - https://github.com/VBA-tools/VBA-UtcConverter ' ' UTC/ISO 8601 Converter for VBA diff --git a/specs/VBA-JSON - Specs.xlsm b/specs/VBA-JSON - Specs.xlsm index 1977d59..fafc00f 100644 Binary files a/specs/VBA-JSON - Specs.xlsm and b/specs/VBA-JSON - Specs.xlsm differ