[haiku-commits] BRANCH mmadia-github.separate-build-environment - headers/build/posix_target

  • From: mmadia-github.separate-build-environment <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 6 Aug 2012 07:49:14 +0200 (CEST)

added 2 changesets to branch 
'refs/remotes/mmadia-github/separate-build-environment'
old head: aeddc3cb059508d24681cd1bce860dba1cb44036
new head: ae8e9a42823003831815bb12b5c3727ca3caf58d

----------------------------------------------------------------------------

ea00836: Added target_errno.h, target_string.h

ae8e9a4: Fixed header include.
  
  Only *_target/target_*.h headers are supposed to include themselves.

                                        [ Matt Madia <mattmadia@xxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 165 insertions(+), 1 deletion(-)
headers/build/posix_target/target_errno.h  |   33 ++++++
headers/build/posix_target/target_string.h |  131 ++++++++++++++++++++++++
src/build/libroot/byteorder.cpp            |    2 +-

############################################################################

Commit:      ea00836a409ef9fffabe913433502cf3ec751e90

Author:      Matt Madia <mattmadia@xxxxxxxxx>
Date:        Mon Aug  6 01:11:41 2012 UTC

Added target_errno.h, target_string.h

----------------------------------------------------------------------------

diff --git a/headers/build/posix_target/target_errno.h 
b/headers/build/posix_target/target_errno.h
new file mode 100644
index 0000000..a5074f0
--- /dev/null
+++ b/headers/build/posix_target/target_errno.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2002-2012 Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _POSIX_ERRNO_H
+#define _POSIX_ERRNO_H
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <target_Errors.h>
+
+#define _HAIKU_BUILD_ENOERR            0
+#define _HAIKU_BUILD_EOK               ENOERR  /* some code assumes EOK exists 
*/
+
+_HAIKU_BUILD_DECLARE_FUNCTION(int*, _errnop, (void))
+#define _haiku_build_errno             (*(_errnop()))
+
+#ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER
+#      define ENOERR                           _HAIKU_BUILD_ENOERR
+#      define EOK                                      _HAIKU_BUILD_EOK
+
+#      define errno                            _haiku_build_errno
+#endif /* _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER */
+
+#ifdef __cplusplus
+} /* "C" */
+#endif
+
+#endif /* _POSIX_ERRNO_H */
diff --git a/headers/build/posix_target/target_string.h 
b/headers/build/posix_target/target_string.h
new file mode 100644
index 0000000..d90a7c6
--- /dev/null
+++ b/headers/build/posix_target/target_string.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2004-2012 Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _STRING_H_
+#define _STRING_H_
+
+
+#include <sys/target_types.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* memXXX() functions */
+_HAIKU_BUILD_DECLARE_FUNCTION(void*, memchr, (const void *source, int value,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+_HAIKU_BUILD_DECLARE_FUNCTION(int, memcmp, (const void *buffer1,
+       const void *buffer2, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+_HAIKU_BUILD_DECLARE_FUNCTION(void*, memcpy, (void *dest, const void *source,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+_HAIKU_BUILD_DECLARE_FUNCTION(void*, memccpy, (void *dest, const void *source,
+       int stopByte, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+_HAIKU_BUILD_DECLARE_FUNCTION(void*, memmove, (void *dest, const void *source,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+_HAIKU_BUILD_DECLARE_FUNCTION(void*, memset, (void *dest, int value,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+
+#ifdef __HAIKU_BUILD_USE_GNU
+_HAIKU_BUILD_DECLARE_FUNCTION(void*, memrchr, (const void *source, int value,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+#endif
+
+/* string functions */
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strcpy, (char *dest, const char *source))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strncpy, (char *dest, const char *source,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strcat, (char *dest, const char *source))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strncat, (char *dest, const char *source,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strlen,
+       (const char *string))
+_HAIKU_BUILD_DECLARE_FUNCTION(int, strcmp, (const char *string1,
+       const char *string2))
+_HAIKU_BUILD_DECLARE_FUNCTION(int, strncmp, (const char *string1,
+       const char *string2, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strchr, (const char *string,
+       int character))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strrchr, (const char *string,
+       int character))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strstr, (const char *string,
+       const char *searchString))
+
+#ifdef __HAIKU_BUILD_USE_GNU
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strchrnul, (const char *string,
+       int character))
+#endif
+
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strpbrk, (const char *string,
+       const char *set))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strtok, (char *string, const char *set))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strtok_r, (char *string, const char *set,
+       char **savePointer))
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strspn,
+       (const char *string, const char *set))
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strcspn,
+       (const char *string, const char *set))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(int, strcoll, (const char *string1,
+       const char *string2))
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strxfrm,
+       (char *string1, const char *string2,
+               _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strerror, (int errorCode))
+_HAIKU_BUILD_DECLARE_FUNCTION(int, strerror_r, (int errorCode, char *buffer,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ bufferSize))
+
+/* non-standard string functions */
+_HAIKU_BUILD_DECLARE_FUNCTION(int, strcasecmp, (const char *string1,
+       const char *string2))
+_HAIKU_BUILD_DECLARE_FUNCTION(int, strncasecmp, (const char *string1,
+       const char *string2, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strcasestr, (const char *string,
+       const char *searchString))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strdup, (const char *string))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strndup, (const char* string,
+       _HAIKU_BUILD_FEATURE___SIZE_TYPE__ size))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, stpcpy, ( char *dest, const char *source))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strlcat,
+       (char *dest, const char *source, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ 
length))
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strlcpy,
+       (char *dest, const char *source, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ 
length))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strnlen,
+       (const char *string, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count))
+
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strlwr, (char *string))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, strupr, (char *string))
+
+/* _HAIKU_BUILD_DECLARE_FUNCTION(char*, strsep(char **stringPointer, const 
char *delimiter); */
+
+_HAIKU_BUILD_DECLARE_FUNCTION(const char*, strsignal, (int signal))
+
+/* legacy compatibility -- might be removed one day */
+#define _haiku_build_bcmp(a, b, length) memcmp((a), (b), (length))
+#define _haiku_build_bcopy(source, dest, length) memmove((dest), (source), 
(length))
+#define _haiku_build_bzero(buffer, length) memset((buffer), 0, (length))
+
+#ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER
+#      define bcmp(a, b, length)                       _haiku_build_bcmp(a, b, 
length)
+#      define bcopy(source, dest, length)      _haiku_build_bcopy(source, 
dest, length)
+#      define bzero(buffer, length)            _haiku_build_bzero(buffer, 
length)
+#endif /* _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER */
+
+_HAIKU_BUILD_DECLARE_FUNCTION(int, ffs, (int i))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, index, (const char *s, int c))
+_HAIKU_BUILD_DECLARE_FUNCTION(char*, rindex, (char const *s, int c))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* _STRING_H_ */

############################################################################

Commit:      ae8e9a42823003831815bb12b5c3727ca3caf58d

Author:      Matt Madia <mattmadia@xxxxxxxxx>
Date:        Mon Aug  6 01:17:03 2012 UTC

Fixed header include.

Only *_target/target_*.h headers are supposed to include themselves.

----------------------------------------------------------------------------

diff --git a/src/build/libroot/byteorder.cpp b/src/build/libroot/byteorder.cpp
index e25a855..6f8917b 100644
--- a/src/build/libroot/byteorder.cpp
+++ b/src/build/libroot/byteorder.cpp
@@ -5,7 +5,7 @@
 //#    include <BeOSBuildCompatibility.h>
 //#endif
 
-#include <target_ByteOrder.h>
+#include <ByteOrder.h>
 
 _haiku_build_uint16
 __haiku_build_swap_int16(_haiku_build_uint16 value)


Other related posts: