@@ -48,10 +48,31 @@ Option Explicit
48
48
' === VBA-UTC Headers
49
49
#If Mac Then
50
50
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
55
76
56
77
#ElseIf VBA7 Then
57
78
@@ -78,11 +99,21 @@ Private Declare Function utc_TzSpecificLocalTimeToSystemTime Lib "kernel32" Alia
78
99
79
100
#If Mac Then
80
101
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
+
81
110
Private Type utc_ShellResult
82
111
utc_Output As String
83
112
utc_ExitCode As Long
84
113
End Type
85
114
115
+ #End If
116
+
86
117
#Else
87
118
88
119
Private Type utc_SYSTEMTIME
@@ -877,7 +908,7 @@ Private Function json_UnsignedAdd(json_Start As Long, json_Increment As Long) As
877
908
End Function
878
909
879
910
''
880
- ' VBA-UTC v1.0.2
911
+ ' VBA-UTC v1.0.3
881
912
' (c) Tim Hall - https://github.com/VBA-tools/VBA-UtcConverter
882
913
'
883
914
' UTC/ISO 8601 Converter for VBA
@@ -1092,9 +1123,15 @@ Private Function utc_ConvertDate(utc_Value As Date, Optional utc_ConvertToUtc As
1092
1123
End Function
1093
1124
1094
1125
Private 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
1095
1130
Dim utc_File As Long
1096
- Dim utc_Chunk As String
1097
1131
Dim utc_Read As Long
1132
+ #End If
1133
+
1134
+ Dim utc_Chunk As String
1098
1135
1099
1136
On Error GoTo utc_ErrorHandling
1100
1137
utc_File = utc_popen(utc_ShellCommand, "r" )
0 commit comments