[haiku-commits] r34286 - haiku/trunk/headers/build

Author: axeld
Date: 2009-11-26 17:02:07 +0100 (Thu, 26 Nov 2009)
New Revision: 34286
Changeset: http://dev.haiku-os.org/changeset/34286/haiku

Modified:
   haiku/trunk/headers/build/BeOSBuildCompatibility.h
Log:
* Map O_NOTRAVERSE to rarely used or non portable O_ modes if possible.
* Fixed indentation.


Modified: haiku/trunk/headers/build/BeOSBuildCompatibility.h
===================================================================
--- haiku/trunk/headers/build/BeOSBuildCompatibility.h  2009-11-26 15:47:08 UTC 
(rev 34285)
+++ haiku/trunk/headers/build/BeOSBuildCompatibility.h  2009-11-26 16:02:07 UTC 
(rev 34286)
@@ -2,10 +2,10 @@
 #define BEOS_BUILD_COMPATIBILITY_H
 
 #if defined(HAIKU_HOST_PLATFORM_CYGWIN)
-#ifndef __addr_t_defined
-#define __addr_t_defined
+#      ifndef __addr_t_defined
+#              define __addr_t_defined
+#      endif
 #endif
-#endif
 
 #if defined(HAIKU_HOST_PLATFORM_CYGWIN) || defined(HAIKU_HOST_PLATFORM_SUNOS)
 #ifndef DEFFILEMODE
@@ -41,52 +41,55 @@
 #endif
 
 // Is kernel-only under Linux.
-extern size_t   strlcpy(char *dest, const char *source, size_t length);
-extern size_t  strlcat(char *dest, const char *source, size_t length);
+extern size_t   strlcpy(char* dest, const char* source, size_t length);
+extern size_t  strlcat(char* dest, const char* source, size_t length);
 
 #if defined(HAIKU_HOST_PLATFORM_FREEBSD) || defined(HAIKU_HOST_PLATFORM_DARWIN)
-extern size_t  strnlen(const char *string, size_t length);
+extern size_t  strnlen(const char* string, size_t length);
 #endif
 
 #if defined(HAIKU_HOST_PLATFORM_CYGWIN) || defined(HAIKU_HOST_PLATFORM_SUNOS)
-extern char * stpcpy(char *dest, const char *src);
-extern char * strcasestr(const char *s, const char *find);
+extern char*   stpcpy(char* dest, const char* src);
+extern char*   strcasestr(const char* s, const char* find);
 #endif
 
 // BeOS only
-extern ssize_t  read_pos(int fd, off_t pos, void *buffer, size_t count);
-extern ssize_t  write_pos(int fd, off_t pos, const void *buffer, size_t count);
-extern ssize_t readv_pos(int fd, off_t pos, const struct iovec *vec,
+extern ssize_t  read_pos(int fd, off_t pos, void* buffer, size_t count);
+extern ssize_t  write_pos(int fd, off_t pos, const void* buffer, size_t count);
+extern ssize_t readv_pos(int fd, off_t pos, const struct iovec* vec,
                                        size_t count);
-extern ssize_t writev_pos(int fd, off_t pos, const struct iovec *vec,
+extern ssize_t writev_pos(int fd, off_t pos, const struct iovec* vec,
                                        size_t count);
 
 
-// There's no O_NOTRAVERSE under Linux and FreeBSD, but there's a O_NOFOLLOW, 
which
-// means something different (open() fails when the file is a symlink), but
-// we can abuse this flag for our purposes (we filter it in libroot).
+// There's no O_NOTRAVERSE under Linux and FreeBSD -- we replace it with a flag
+// that won't be used by our tools, preferrably a non-portable one; a fixed
+// constant could always lead to trouble on the host.
+// We can abuse this flag for our purposes as we filter it in libroot.
 #ifndef O_NOTRAVERSE
-        #ifdef O_NOFOLLOW
-                #define O_NOTRAVERSE O_NOFOLLOW
-        #else
-                #define O_NOTRAVERSE 0
-        #endif
+#      ifdef O_NOCTTY
+#              define O_NOTRAVERSE     O_NOCTTY
+#      elif defined(O_RANDOM)
+#              define O_NOTRAVERSE O_RANDOM
+#      else
+#              error "Search for a proper replacement value for O_NOTRAVERSE"
+#      endif
 #endif
 
 #ifndef S_IUMSK
-       #define S_IUMSK ALLPERMS
+#      define S_IUMSK ALLPERMS
 #endif
 
 
 // remap strerror()
-extern char *_haiku_build_strerror(int errnum);
+extern char* _haiku_build_strerror(int errnum);
 
 #ifndef BUILDING_HAIKU_ERROR_MAPPER
 
 #undef strerror
 #define strerror(errnum)       _haiku_build_strerror(errnum)
 
-#endif
+#endif // BUILDING_HAIKU_ERROR_MAPPER
 
 #ifdef __cplusplus
 } // extern "C"


Other related posts:

  • » [haiku-commits] r34286 - haiku/trunk/headers/build - axeld