From c7c82420e1268d9b6dd484f8f84590b45ddf39cf Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 25 Mar 2008 01:56:46 +0000 Subject: [PATCH] _single_threaded should have C linkage. Was for some reason only a problem with gcc 4. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24565 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/stdio_post.h | 8 ++++++++ headers/private/libroot/libroot_private.h | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/headers/posix/stdio_post.h b/headers/posix/stdio_post.h index 8f4db8a5f2..7418063371 100644 --- a/headers/posix/stdio_post.h +++ b/headers/posix/stdio_post.h @@ -14,11 +14,19 @@ # error "This file must be included from stdio.h!" #endif +#ifdef __cplusplus +extern "C" { +#endif + extern char _single_threaded; // this boolean value is true (1) if there is only the main thread // running - as soon as you spawn the first thread, it's set to // false (0) +#ifdef __cplusplus +} +#endif + #define getc(stream) \ (_single_threaded ? getc_unlocked(stream) : getc(stream)) #define putc(c, stream) \ diff --git a/headers/private/libroot/libroot_private.h b/headers/private/libroot/libroot_private.h index 4d0e91ca2c..67475be5a9 100644 --- a/headers/private/libroot/libroot_private.h +++ b/headers/private/libroot/libroot_private.h @@ -13,14 +13,14 @@ struct user_space_program_args; struct real_time_data; -extern char _single_threaded; - /* This determines if a process runs single threaded or not */ - #ifdef __cplusplus extern "C" { #endif +extern char _single_threaded; + /* This determines if a process runs single threaded or not */ + status_t __parse_invoke_line(char *invoker, char ***_newArgs, char * const **_oldArgs, int32 *_argCount, const char *arg0); status_t __get_next_image_dependency(image_id id, uint32 *cookie,