This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 64fc3e831b4be0b8f6072176ff69e14158836559
Author: Marco Casaroli <[email protected]>
AuthorDate: Sat Oct 17 20:06:12 2026 +0200

    include: Do not use OK and ERROR in pthread.h and threads.h macros.
    
    PTHREAD_CANCELED, thrd_success and thrd_error expanded to the names
    OK and ERROR from sys/types.h. These macros expand in the program, so
    a program that defines its own OK or ERROR got a different value.
    
    Use the numbers 0 and -1. The values do not change.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 include/pthread.h | 2 +-
 include/threads.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/pthread.h b/include/pthread.h
index 201d593051b..211d55522ee 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -135,7 +135,7 @@
 
 /* Thread return value when a pthread is canceled */
 
-#define PTHREAD_CANCELED              ((FAR void*)ERROR)
+#define PTHREAD_CANCELED              ((FAR void *)-1)
 
 /* Used to initialize a pthread_once_t */
 
diff --git a/include/threads.h b/include/threads.h
index e00184bc709..334d124e062 100644
--- a/include/threads.h
+++ b/include/threads.h
@@ -41,11 +41,11 @@
 
 /* Indicates thread error status */
 
-#define thrd_success  (OK)
+#define thrd_success  (0)
 #define thrd_timedout (ETIMEDOUT)
 #define thrd_busy     (EBUSY)
 #define thrd_nomem    (ENOMEM)
-#define thrd_error    (ERROR)
+#define thrd_error    (-1)
 
 /* Defines the type of a mutex */
 

Reply via email to