@@ -48,10 +48,31 @@ Option Explicit
4848' === VBA-UTC Headers
4949#If Mac Then
5050
51- Private Declare Function utc_popen Lib "libc .dylib " Alias "popen " (ByVal utc_Command As String , ByVal utc_Mode As String ) As Long
52- Private Declare Function utc_pclose Lib "libc .dylib " Alias "pclose " (ByVal utc_File As Long ) As Long
53- 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
54- Private Declare Function utc_feof Lib "libc .dylib " Alias "feof " (ByVal utc_File As Long ) As Long
51+ #If VBA7 Then
52+
53+ ' 64-bit Mac (2016)
54+ Private Declare PtrSafe Function utc_popen Lib "libc .dylib " Alias "popen " _
55+ (ByVal utc_Command As String , ByVal utc_Mode As String ) As LongPtr
56+ Private Declare PtrSafe Function utc_pclose Lib "libc .dylib " Alias "pclose " _
57+ (ByVal utc_File As Long ) As LongPtr
58+ Private Declare PtrSafe Function utc_fread Lib "libc .dylib " Alias "fread " _
59+ (ByVal utc_Buffer As String , ByVal utc_Size As LongPtr , ByVal utc_Number As LongPtr , ByVal utc_File As LongPtr ) As LongPtr
60+ Private Declare PtrSafe Function utc_feof Lib "libc .dylib " Alias "feof " _
61+ (ByVal utc_File As LongPtr ) As LongPtr
62+
63+ #Else
64+
65+ ' 32-bit Mac
66+ Private Declare Function utc_popen Lib "libc .dylib " Alias "popen " _
67+ (ByVal utc_Command As String , ByVal utc_Mode As String ) As Long
68+ Private Declare Function utc_pclose Lib "libc .dylib " Alias "pclose " _
69+ (ByVal utc_File As Long ) As Long
70+ Private Declare Function utc_fread Lib "libc .dylib " Alias "fread " _
71+ (ByVal utc_Buffer As String , ByVal utc_Size As Long , ByVal utc_Number As Long , ByVal utc_File As Long ) As Long
72+ Private Declare Function utc_feof Lib "libc .dylib " Alias "feof " _
73+ (ByVal utc_File As Long ) As Long
74+
75+ #End If
5576
5677#ElseIf VBA7 Then
5778
@@ -78,11 +99,21 @@ Private Declare Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alia
7899
79100#If Mac Then
80101
102+ #If VBA7 Then
103+ Private Type utc_ShellResult
104+ utc_Output As String
105+ utc_ExitCode As LongPtr
106+ End Type
107+
108+ #Else
109+
81110Private Type utc_ShellResult
82111 utc_Output As String
83112 utc_ExitCode As Long
84113End Type
85114
115+ #End If
116+
86117#Else
87118
88119Private Type utc_SYSTEMTIME
@@ -877,7 +908,7 @@ Private Function json_UnsignedAdd(json_Start As Long, json_Increment As Long) As
877908End Function
878909
879910''
880- ' VBA-UTC v1.0.2
911+ ' VBA-UTC v1.0.3
881912' (c) Tim Hall - https://github.com/VBA-tools/VBA-UtcConverter
882913'
883914' UTC/ISO 8601 Converter for VBA
@@ -1092,9 +1123,15 @@ Private Function utc_ConvertDate(utc_Value As Date, Optional utc_ConvertToUtc As
10921123End Function
10931124
10941125Private Function utc_ExecuteInShell (utc_ShellCommand As String ) As utc_ShellResult
1126+ #If VBA7 Then
1127+ Dim utc_File As LongPtr
1128+ Dim utc_Read As LongPtr
1129+ #Else
10951130 Dim utc_File As Long
1096- Dim utc_Chunk As String
10971131 Dim utc_Read As Long
1132+ #End If
1133+
1134+ Dim utc_Chunk As String
10981135
10991136 On Error GoTo utc_ErrorHandling
11001137 utc_File = utc_popen(utc_ShellCommand, "r" )
0 commit comments