summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-01-05 11:03:44 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commitbddc75fb8c2e9f59797c9f6fd25aaed3b1778fd8 (patch)
tree5c95014588f87728a3014587c92052515d5dc258 /misc.c
parentce1f87461b04c05f8502b502e387dd1130e7830c (diff)
2011-01-05 Ivan Maidanski <ivmai@mail.ru>
* misc.c (GC_write): Replace multiple "ifdef/endif" with "elif" (for ECOS and NOSYS). * os_dep.c (GC_get_main_stack_base): Ditto. * os_dep.c (GC_get_main_stack_base): Check USE_GET_STACKBASE_FOR_MAIN macro before checking STACKBOTTOM one; remove "dummy" variable (use result one instead); reformat the code. * doc/README.macros (SN_TARGET_PS3): Document. * extra/threadlibs.c (main): Don't output "-lpthread" (and "-ldl") for Android. * include/private/pthread_support.h: Fix comment for "endif".
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/misc.c b/misc.c
index edd8f7f..7b38ee1 100644
--- a/misc.c
+++ b/misc.c
@@ -1171,10 +1171,21 @@ GC_API void GC_CALL GC_enable_incremental(void)
# endif
#endif
-#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(OS2) \
- && !defined(MACOS) && !defined(ECOS) && !defined(NOSYS)
-STATIC int GC_write(int fd, const char *buf, size_t len)
-{
+#if defined(ECOS) || defined(NOSYS)
+ STATIC int GC_write(int fd, const char *buf, size_t len)
+ {
+# ifdef ECOS
+ /* FIXME: This seems to be defined nowhere at present. */
+ /* _Jv_diag_write(buf, len); */
+# else
+ /* No writing. */
+# endif
+ return len;
+ }
+#elif !defined(MSWIN32) && !defined(MSWINCE) && !defined(OS2) \
+ && !defined(MACOS)
+ STATIC int GC_write(int fd, const char *buf, size_t len)
+ {
int bytes_written = 0;
int result;
IF_CANCEL(int cancel_state;)
@@ -1195,26 +1206,8 @@ STATIC int GC_write(int fd, const char *buf, size_t len)
}
RESTORE_CANCEL(cancel_state);
return(bytes_written);
-}
-#endif /* UN*X */
-
-#ifdef ECOS
- STATIC int GC_write(int fd, const char *buf, size_t len)
- {
- /* FIXME: This seems to be defined nowhere at present. */
- /* _Jv_diag_write(buf, len); */
- return len;
- }
-#endif
-
-#ifdef NOSYS
- STATIC int GC_write(int fd, const char *buf, size_t len)
- {
- /* No writing. */
- return len;
}
-#endif
-
+#endif /* UN*X */
#if defined(MSWIN32) || defined(MSWINCE)
/* FIXME: This is pretty ugly ... */