Browse Source

smslib build bustage with macOS SDK 14

Bill Gianopoulos 1 year ago
parent
commit
f9a77874c8

+ 68 - 0
mozilla-central/patches/TOP-PLASTER-smslib-build-bustage.patch

@@ -0,0 +1,68 @@
+# HG changeset patch
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
+# Date 1696258608 0
+Fix smslib build bustage with macOS SDK 14.
+
+diff --git a/hal/cocoa/smslib.mm b/hal/cocoa/smslib.mm
+--- a/hal/cocoa/smslib.mm
++++ b/hal/cocoa/smslib.mm
+@@ -568,29 +568,22 @@ void smsGetBufferData(char* buffer) {
+   kern_return_t result;
+ 
+   if (debugging || running == NO) {
+     return;
+   }
+ 
+   memset(iRecord, 1, iSize);
+   memset(buffer, 0, oSize);
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+   const size_t InStructSize = recordSize;
+   size_t OutStructSize = recordSize;
+   result = IOConnectCallStructMethod(connection,
+                                      function,  // magic kernel function number
+                                      (const void*)iRecord, InStructSize,
+                                      (void*)buffer, &OutStructSize);
+-#else   // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
+-  result = IOConnectMethodStructureIStructureO(
+-      connection,
+-      function,  // magic kernel function number
+-      iSize, &oSize, iRecord, buffer);
+-#endif  // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
+ 
+   if (result != KERN_SUCCESS) {
+     running = NO;
+   }
+ }
+ 
+ // This returns an NSString describing the current calibration in
+ // human-readable form. Also include a description of the machine.
+@@ -779,29 +772,22 @@ int getData(sms_acceleration* accel, int
+   }
+ 
+   memset(iRecord, 1, iSize);
+   memset(oRecord, 0, oSize);
+ 
+   LOG_2ARG(@"    Querying device (%u, %d): ", sensors[sensorNum].function,
+            sensors[sensorNum].recordSize);
+ 
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+   const size_t InStructSize = recordSize;
+   size_t OutStructSize = recordSize;
+   result = IOConnectCallStructMethod(connection,
+                                      function,  // magic kernel function number
+                                      (const void*)iRecord, InStructSize,
+                                      (void*)oRecord, &OutStructSize);
+-#else   // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
+-  result = IOConnectMethodStructureIStructureO(
+-      connection,
+-      function,  // magic kernel function number
+-      iSize, &oSize, iRecord, oRecord);
+-#endif  // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
+ 
+   if (result != KERN_SUCCESS) {
+     LOG(@"failed.\n");
+     running = NO;
+     return result;
+   } else {
+     LOG(@"succeeded.\n");
+ 

+ 1 - 0
mozilla-central/patches/series

@@ -1,2 +1,3 @@
 9999999-NSSgetentropy.patch
 1807834-respect-dmg-hfs-env.patch
+TOP-PLASTER-smslib-build-bustage.patch