-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
97 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
From e8ac303a29cfc9950306a4d22f9eaed5a9196bd2 Mon Sep 17 00:00:00 2001 | ||
From: Paulo Medeiros <[email protected]> | ||
Date: Sun, 14 Jan 2024 00:51:07 -0100 | ||
Subject: [PATCH] Implement Semaphore CarbonCore Stubs and change | ||
MPCriticalRegionID | ||
|
||
--- | ||
.../include/CarbonCore/Multiprocessing.h | 9 ++++-- | ||
.../src/CarbonCore/Multiprocessing.cpp | 31 +++++++++++++++++++ | ||
2 files changed, 38 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h b/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h | ||
index 887718b80b..b74ffbab97 100644 | ||
--- a/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h | ||
+++ b/src/frameworks/CoreServices/include/CarbonCore/Multiprocessing.h | ||
@@ -13,7 +13,9 @@ enum { | ||
kDurationMicrosecond = -1 | ||
}; | ||
|
||
-typedef void* MPCriticalRegionID; | ||
+typedef struct OpaqueMPCriticalRegionID *MPCriticalRegionID; | ||
+typedef struct OpaqueMPSemaphoreID *MPSemaphoreID; | ||
+typedef ItemCount MPSemaphoreCount; | ||
|
||
Boolean _MPIsFullyInitialized(); | ||
OSStatus MPDelayUntil(AbsoluteTime* time); | ||
@@ -23,7 +25,10 @@ OSStatus MPCreateCriticalRegion(MPCriticalRegionID* criticalRegion); | ||
OSStatus MPDeleteCriticalRegion(MPCriticalRegionID criticalRegion); | ||
OSStatus MPEnterCriticalRegion(MPCriticalRegionID criticalRegion, Duration timeout); | ||
OSStatus MPExitCriticalRegion(MPCriticalRegionID criticalRegion); | ||
- | ||
+OSStatus MPCreateSemaphore(MPSemaphoreCount maximumValue, MPSemaphoreCount initialValue, MPSemaphoreID *semaphore); | ||
+OSStatus MPDeleteSemaphore(MPSemaphoreID semaphore); | ||
+OSStatus MPSignalSemaphore(MPSemaphoreID semaphore); | ||
+OSStatus MPWaitOnSemaphore(MPSemaphoreID semaphore, Duration timeout); | ||
// other functions are missing... | ||
|
||
#ifdef __cplusplus | ||
diff --git a/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp b/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp | ||
index a161ba3db3..0527755093 100644 | ||
--- a/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp | ||
+++ b/src/frameworks/CoreServices/src/CarbonCore/Multiprocessing.cpp | ||
@@ -21,8 +21,15 @@ along with Darling. If not, see <http://www.gnu.org/licenses/>. | ||
#include <unistd.h> | ||
#include <ctime> | ||
#include <pthread.h> | ||
+#include <stdio.h> | ||
+#include <stdlib.h> | ||
#include <CarbonCore/MacErrors.h> | ||
|
||
+static int verbose = 0; | ||
+__attribute__((constructor)) static void initme(void) { | ||
+ verbose = getenv("STUB_VERBOSE") != NULL; | ||
+} | ||
+ | ||
Boolean _MPIsFullyInitialized() | ||
{ | ||
return true; | ||
@@ -109,3 +116,27 @@ OSStatus MPExitCriticalRegion(MPCriticalRegionID criticalRegion) | ||
else | ||
return paramErr; | ||
} | ||
+ | ||
+OSStatus MPCreateSemaphore(MPSemaphoreCount maximumValue, MPSemaphoreCount initialValue, MPSemaphoreID *semaphore) | ||
+{ | ||
+ if (verbose) puts("STUB: MPCreateSemaphore called"); | ||
+ return noErr; | ||
+} | ||
+ | ||
+OSStatus MPDeleteSemaphore(MPSemaphoreID semaphore) | ||
+{ | ||
+ if (verbose) puts("STUB: MPDeleteSemaphore called"); | ||
+ return noErr; | ||
+} | ||
+ | ||
+OSStatus MPSignalSemaphore(MPSemaphoreID semaphore) | ||
+{ | ||
+ if (verbose) puts("STUB: MPSignalSemaphore called"); | ||
+ return noErr; | ||
+} | ||
+ | ||
+OSStatus MPWaitOnSemaphore(MPSemaphoreID semaphore, Duration timeout) | ||
+{ | ||
+ if (verbose) puts("STUB: MPWaitOnSemaphore called"); | ||
+ return noErr; | ||
+} | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule SmartCardServices
updated
15 files
Submodule cocotron
updated
2 files
+3 −0 | AppKit/NSApplication.m | |
+2 −0 | AppKit/include/AppKit/NSApplication.h |
Submodule foundation
updated
2 files
+11 −2 | include/Foundation/NSUserNotification.h | |
+21 −0 | src/NSUserNotification.m |
Submodule libressl-2.2.9
updated
1306 files
Submodule libressl-2.5.5
updated
1463 files
Submodule libressl-2.6.5
updated
1482 files
Submodule libressl-2.8.3
updated
1530 files
Submodule openjdk
updated
from 3c6eb7 to 18a33a