Browse Source

better fix for macOS smslib.mm bustage

Bill Gianopoulos 1 year ago
parent
commit
991bff9d2d
1 changed files with 8 additions and 30 deletions
  1. 8 30
      mozilla-central/patches/TOP-PLASTER-smslib-build-bustage.patch

+ 8 - 30
mozilla-central/patches/TOP-PLASTER-smslib-build-bustage.patch

@@ -6,7 +6,7 @@ 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) {
+@@ -568,17 +568,17 @@ void smsGetBufferData(char* buffer) {
    kern_return_t result;
  
    if (debugging || running == NO) {
@@ -16,27 +16,16 @@ diff --git a/hal/cocoa/smslib.mm b/hal/cocoa/smslib.mm
    memset(iRecord, 1, iSize);
    memset(buffer, 0, oSize);
 -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
++#if __MAC_OS_X_VERSION_MIN_REQUIRED == 0 || __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
+ #else   // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
+   result = IOConnectMethodStructureIStructureO(
+@@ -779,17 +779,17 @@ int getData(sms_acceleration* accel, int
    }
  
    memset(iRecord, 1, iSize);
@@ -46,23 +35,12 @@ diff --git a/hal/cocoa/smslib.mm b/hal/cocoa/smslib.mm
             sensors[sensorNum].recordSize);
  
 -#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
++#if __MAC_OS_X_VERSION_MIN_REQUIRED == 0 || __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");
- 
+ #else   // __MAC_OS_X_VERSION_MIN_REQUIRED 1050
+   result = IOConnectMethodStructureIStructureO(