Skip to content

Commit

Permalink
Update Submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
Fancy2209 committed Jan 14, 2024
1 parent 5ee6a68 commit 1136171
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 10 deletions.
87 changes: 87 additions & 0 deletions 1470.patch
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ string(TOLOWER "${ENABLE_METAL}" BUILD_METAL)

if(BUILD_METAL STREQUAL "auto")
# check if Vulkan and LLVM are available
find_program(LLVM_CONFIG_PROGRAM llvm-config)
find_program(LLVM_CONFIG_PROGRAM llvm-config-14)
find_package(Vulkan)

if(LLVM_CONFIG_PROGRAM AND Vulkan_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion src/external/TextEdit
Submodule TextEdit updated 1 files
+4 −1 CMakeLists.txt
2 changes: 1 addition & 1 deletion src/external/cocotron
2 changes: 1 addition & 1 deletion src/external/foundation
2 changes: 1 addition & 1 deletion src/external/libressl-2.2.9
Submodule libressl-2.2.9 updated 1306 files
2 changes: 1 addition & 1 deletion src/external/libressl-2.5.5
Submodule libressl-2.5.5 updated 1463 files
2 changes: 1 addition & 1 deletion src/external/libressl-2.6.5
Submodule libressl-2.6.5 updated 1482 files
2 changes: 1 addition & 1 deletion src/external/libressl-2.8.3
Submodule libressl-2.8.3 updated 1530 files
2 changes: 1 addition & 1 deletion src/external/openjdk

0 comments on commit 1136171

Please sign in to comment.