git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] win32: remove return_0 inline function

From
RGRose via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 31, 2022, 02:20 UTC
Message-ID
<pull.1420.git.git.1672453222075.gitgitgadget@gmail.com>
From: Seija Kijin <doremylover123@gmail.com>
The macro works on its own without the helper function
Signed-off-by: Seija Kijin <doremylover123@gmail.com>
---
    win32: remove return_0 inline function
    
    The macro works on its own without the helper function
    
    Signed-off-by: Seija Kijin doremylover123@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1420%2FAtariDreams%2Fcondition-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1420/AtariDreams/condition-v1
Pull-Request: https://github.com/git/git/pull/1420
 compat/win32/pthread.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index 737983d00ba..18aa2e1241d 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -18,10 +18,10 @@
  */
 #define pthread_mutex_t CRITICAL_SECTION
 
-static inline int return_0(int i) {
-	return 0;
+static inline int return_i(int i) {
+	return i;
 }
-#define pthread_mutex_init(a,b) return_0((InitializeCriticalSection((a)), 0))
+#define pthread_mutex_init(a,b) return_i((InitializeCriticalSection((a)), 0))
 #define pthread_mutex_destroy(a) DeleteCriticalSection((a))
 #define pthread_mutex_lock EnterCriticalSection
 #define pthread_mutex_unlock LeaveCriticalSection
@@ -36,7 +36,7 @@ typedef int pthread_mutexattr_t;
 
 #define pthread_cond_init(a,b) InitializeConditionVariable((a))
 #define pthread_cond_destroy(a) do {} while (0)
-#define pthread_cond_wait(a,b) return_0(SleepConditionVariableCS((a), (b), INFINITE))
+#define pthread_cond_wait(a,b) SleepConditionVariableCS((a), (b), INFINITE)
 #define pthread_cond_signal WakeConditionVariable
 #define pthread_cond_broadcast WakeAllConditionVariable
 

base-commit: 6bae53b138a1f38d8887f6b46d17661357a1468b
-- 
gitgitgadget
Next: Đoàn Trần Công Danh
Message 1 of 2 in “win32: remove return_0 inline function”
  1. win32: remove return_0 inline functionRose via GitGitGadget, Dec 31, 2022
  2. Đoàn Trần Công DanhDec 31, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.