added 4 changesets to branch 'refs/remotes/mmadia-github/separate-build-environment' old head: 9479a5c77407b9406b405fa2cf0ab3d4e72aca30 new head: 128e3675595d54564cc99c20c07ed65f21e167be ---------------------------------------------------------------------------- d7a26d8: Replace _HAIKU_BUILD_FEATURE___SIZE_TYPE__ with size_t. TODO: re-add #include <stddef.h> and adjust where necessary. 9b2dc92: Re-add #include stddef.h 989de4d: Pass definitions of _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 For now only atomic.cpp, byteorder.cpp and find_directory.cpp have _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 defined. Uncertain if SubDirCcFlags, SubDirC++Flags can have it instead. 128e367: Add prefixes/macros for struct stat and stat(). [ Matt Madia <mattmadia@xxxxxxxxx> ] ---------------------------------------------------------------------------- 11 files changed, 77 insertions(+), 98 deletions(-) headers/build/os_target/support/target_ByteOrder.h | 5 +- headers/build/posix_target/sys/target_stat.h | 12 ++-- headers/build/posix_target/target_alloca.h | 6 +- headers/build/posix_target/target_size_t.h | 2 + headers/build/posix_target/target_stdlib.h | 46 ++++++--------- headers/build/posix_target/target_string.h | 49 ++++++++-------- headers/build/posix_target/target_time.h | 4 +- headers/build/posix_target/target_unistd.h | 37 +++++------- headers/build/posix_target/target_wchar_t.h | 2 +- src/build/libroot/Jamfile | 2 + src/build/libroot/find_directory.cpp | 10 ++-- ############################################################################ Commit: d7a26d8474ebdcb1f1b3043abaac5eb9b9dc2180 Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 12:19:08 2012 UTC Replace _HAIKU_BUILD_FEATURE___SIZE_TYPE__ with size_t. TODO: re-add #include <stddef.h> and adjust where necessary. ---------------------------------------------------------------------------- diff --git a/headers/build/os_target/support/target_ByteOrder.h b/headers/build/os_target/support/target_ByteOrder.h index 185332f..89ba081 100644 --- a/headers/build/os_target/support/target_ByteOrder.h +++ b/headers/build/os_target/support/target_ByteOrder.h @@ -114,9 +114,8 @@ extern "C" { #endif _HAIKU_BUILD_DECLARE_FUNCTION(_haiku_build_status_t, swap_data, - (_haiku_build_type_code type, void *data, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length, - _HAIKU_BUILD_IDENTIFIER(swap_action) action)) + (_haiku_build_type_code type, void *data, size_t length, + _HAIKU_BUILD_IDENTIFIER(swap_action) action)) _HAIKU_BUILD_DECLARE_FUNCTION(bool, is_type_swapped, (_haiku_build_type_code type)) diff --git a/headers/build/posix_target/target_alloca.h b/headers/build/posix_target/target_alloca.h index 0bcacd3..27eb02b 100644 --- a/headers/build/posix_target/target_alloca.h +++ b/headers/build/posix_target/target_alloca.h @@ -18,10 +18,8 @@ extern "C" { // NOTE: #8730 -- uncertain if these functions need to have the same names as // the macro definitions. -_HAIKU_BUILD_DECLARE_FUNCTION(void*, __alloca, - (_HAIKU_BUILD_FEATURE___SIZE_TYPE__ __size)) -_HAIKU_BUILD_DECLARE_FUNCTION(void*, alloca, - (_HAIKU_BUILD_FEATURE___SIZE_TYPE__ __size)) +_HAIKU_BUILD_DECLARE_FUNCTION(void*, __alloca, (size_t __size)) +_HAIKU_BUILD_DECLARE_FUNCTION(void*, alloca, (size_t __size)) #ifdef __cplusplus } diff --git a/headers/build/posix_target/target_stdlib.h b/headers/build/posix_target/target_stdlib.h index 0613906..63ef846 100644 --- a/headers/build/posix_target/target_stdlib.h +++ b/headers/build/posix_target/target_stdlib.h @@ -52,15 +52,13 @@ extern "C" { /* memory allocation (see malloc.h for additional defines & prototypes) */ _HAIKU_BUILD_DECLARE_FUNCTION(void*, calloc, - (_HAIKU_BUILD_FEATURE___SIZE_TYPE__ numElements, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ size)) + (size_t numElements, size_t size)) _HAIKU_BUILD_DECLARE_FUNCTION(void, free, (void *pointer)) -_HAIKU_BUILD_DECLARE_FUNCTION(void*, malloc, (_HAIKU_BUILD_FEATURE___SIZE_TYPE__ size)) +_HAIKU_BUILD_DECLARE_FUNCTION(void*, malloc, (size_t size)) _HAIKU_BUILD_DECLARE_FUNCTION(int, posix_memalign, (void **_pointer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ alignment, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ size)) + size_t alignment, size_t size)) _HAIKU_BUILD_DECLARE_FUNCTION(void*, realloc, (void *oldPointer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ newSize)) + size_t newSize)) /* process termination */ _HAIKU_BUILD_DECLARE_FUNCTION(void, abort, (void)) @@ -127,12 +125,10 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, random_r, _HAIKU_BUILD_DECLARE_FUNCTION(int, srandom_r, (unsigned int seed, struct _HAIKU_BUILD_IDENTIFIER(random_data) *data)) _HAIKU_BUILD_DECLARE_FUNCTION(char*, initstate, - (unsigned int seed, char *state, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ size)) -_HAIKU_BUILD_DECLARE_FUNCTION(char* ,setstate, - (char *state)) + (unsigned int seed, char *state, size_t size)) +_HAIKU_BUILD_DECLARE_FUNCTION(char*, setstate, (char *state)) _HAIKU_BUILD_DECLARE_FUNCTION(int, initstate_r, - (unsigned int seed, void *stateBuffer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ stateLength, + (unsigned int seed, void *stateBuffer, size_t stateLength, struct _HAIKU_BUILD_IDENTIFIER(random_data) *data)) _HAIKU_BUILD_DECLARE_FUNCTION(int, setstate_r, (void *stateBuffer, struct _HAIKU_BUILD_IDENTIFIER(random_data) *data)) @@ -170,17 +166,14 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, lcong48_r, (unsigned short int param[7], typedef int (*_compare_function)(const void *, const void *); _HAIKU_BUILD_DECLARE_FUNCTION(void*, bsearch, (const void *key, - const void *base, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ numElements, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ sizeOfElement, _compare_function)) + const void *base, size_t numElements, size_t sizeOfElement, + _compare_function)) _HAIKU_BUILD_DECLARE_FUNCTION(int, heapsort, (void *base, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ numElements, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ sizeOfElement, _compare_function)) + size_t numElements, size_t sizeOfElement, _compare_function)) _HAIKU_BUILD_DECLARE_FUNCTION(int, mergesort, (void *base, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ numElements, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ sizeOfElement, _compare_function)) + size_t numElements, size_t sizeOfElement, _compare_function)) _HAIKU_BUILD_DECLARE_FUNCTION(void, qsort, (void *base, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ numElements, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ sizeOfElement, _compare_function)) + size_t numElements, size_t sizeOfElement, _compare_function)) _HAIKU_BUILD_DECLARE_FUNCTION(int, radixsort, (_haiku_build_u_char const **base, int numElements, _haiku_build_u_char const *table, _haiku_build_u_int endByte)) @@ -201,18 +194,15 @@ _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(lldiv_t), lldiv, (long long numerator, long long denominator)) /* wide & multibyte string functions */ -_HAIKU_BUILD_DECLARE_FUNCTION(int, mblen, - (const char *string, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ maxSize)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, mblen, (const char *string, size_t maxSize)) // TODO: #8730 -- which _HAIKU_BUILD_FEATURE_* for wchar_t? _HAIKU_BUILD_DECLARE_FUNCTION(int, mbtowc, (wchar_t *pwc, - const char *string, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ maxSize)) + const char *string, size_t maxSize)) _HAIKU_BUILD_DECLARE_FUNCTION(int, wctomb, (char *string, wchar_t wchar)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, mbstowcs, - (wchar_t *pwcs, const char *string, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ maxSize)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, wcstombs, - (char *string, const wchar_t *pwcs, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ maxSize)) +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, mbstowcs, + (wchar_t *pwcs, const char *string, size_t maxSize)) +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, wcstombs, + (char *string, const wchar_t *pwcs, size_t maxSize)) /* crypt */ _HAIKU_BUILD_DECLARE_FUNCTION(void, setkey, (const char *key)) diff --git a/headers/build/posix_target/target_string.h b/headers/build/posix_target/target_string.h index d90a7c6..022b263 100644 --- a/headers/build/posix_target/target_string.h +++ b/headers/build/posix_target/target_string.h @@ -16,37 +16,36 @@ extern "C" { /* memXXX() functions */ _HAIKU_BUILD_DECLARE_FUNCTION(void*, memchr, (const void *source, int value, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + size_t length)) _HAIKU_BUILD_DECLARE_FUNCTION(int, memcmp, (const void *buffer1, - const void *buffer2, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + const void *buffer2, size_t length)) _HAIKU_BUILD_DECLARE_FUNCTION(void*, memcpy, (void *dest, const void *source, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + size_t length)) _HAIKU_BUILD_DECLARE_FUNCTION(void*, memccpy, (void *dest, const void *source, - int stopByte, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + int stopByte, size_t length)) _HAIKU_BUILD_DECLARE_FUNCTION(void*, memmove, (void *dest, const void *source, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + size_t length)) _HAIKU_BUILD_DECLARE_FUNCTION(void*, memset, (void *dest, int value, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + size_t length)) #ifdef __HAIKU_BUILD_USE_GNU _HAIKU_BUILD_DECLARE_FUNCTION(void*, memrchr, (const void *source, int value, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + size_t 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)) + size_t 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)) + size_t length)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strlen, - (const char *string)) +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, 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)) + const char *string2, size_t length)) _HAIKU_BUILD_DECLARE_FUNCTION(char*, strchr, (const char *string, int character)) @@ -65,42 +64,42 @@ _HAIKU_BUILD_DECLARE_FUNCTION(char*, strpbrk, (const char *string, _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, +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, strspn, (const char *string, const char *set)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strcspn, +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, 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, +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, strxfrm, (char *string1, const char *string2, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ length)) + size_t 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)) + size_t 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)) + const char *string2, size_t 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)) + size_t 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(size_t, strlcat, + (char *dest, const char *source, size_t length)) +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, strlcpy, + (char *dest, const char *source, size_t length)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strnlen, - (const char *string, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count)) +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, strnlen, + (const char *string, size_t count)) _HAIKU_BUILD_DECLARE_FUNCTION(char*, strlwr, (char *string)) _HAIKU_BUILD_DECLARE_FUNCTION(char*, strupr, (char *string)) diff --git a/headers/build/posix_target/target_time.h b/headers/build/posix_target/target_time.h index 9affa51..394353c 100644 --- a/headers/build/posix_target/target_time.h +++ b/headers/build/posix_target/target_time.h @@ -97,8 +97,8 @@ _HAIKU_BUILD_DECLARE_FUNCTION(struct _HAIKU_BUILD_IDENTIFIER(tm) *, struct _HAIKU_BUILD_IDENTIFIER(tm) *tm)) _HAIKU_BUILD_DECLARE_FUNCTION(int, nanosleep, (const _HAIKU_BUILD_IDENTIFIER(timespec) *, _HAIKU_BUILD_IDENTIFIER(timespec) *)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, strftime, - (char *buffer, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ maxSize, const char *format, +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, strftime, + (char *buffer, size_t maxSize, const char *format, const struct _HAIKU_BUILD_IDENTIFIER(tm) *tm)) _HAIKU_BUILD_DECLARE_FUNCTION(char *, strptime, (const char *buf, const char *format, struct _HAIKU_BUILD_IDENTIFIER(tm) *tm)) diff --git a/headers/build/posix_target/target_unistd.h b/headers/build/posix_target/target_unistd.h index ce178c6..786fd47 100644 --- a/headers/build/posix_target/target_unistd.h +++ b/headers/build/posix_target/target_unistd.h @@ -301,8 +301,7 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, faccessat, _HAIKU_BUILD_DECLARE_FUNCTION(int, chdir, (const char *path)) _HAIKU_BUILD_DECLARE_FUNCTION(int, fchdir, (int fd)) -_HAIKU_BUILD_DECLARE_FUNCTION(char*, getcwd, (char *buffer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ size)) +_HAIKU_BUILD_DECLARE_FUNCTION(char*, getcwd, (char *buffer, size_t size)) _HAIKU_BUILD_DECLARE_FUNCTION(int, pipe, (int fildes[2])) _HAIKU_BUILD_DECLARE_FUNCTION(int, dup, (int fd)) @@ -318,11 +317,9 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, unlinkat, (int fd, const char *path, _HAIKU_BUILD_DECLARE_FUNCTION(int, rmdir, (const char *path)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), readlink, - (const char *path, char *buffer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ bufferSize)) + (const char *path, char *buffer, size_t bufferSize)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), readlinkat, - (int fd, const char *path, char *buffer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ bufferSize)) + (int fd, const char *path, char *buffer, size_t bufferSize)) _HAIKU_BUILD_DECLARE_FUNCTION(int, symlink, (const char *toPath, const char *symlinkPath)) _HAIKU_BUILD_DECLARE_FUNCTION(int, symlinkat, (const char *toPath, int fd, @@ -335,20 +332,17 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, truncate, (const char *path, _HAIKU_BUILD_DECLARE_FUNCTION(int, ioctl, (int fd, unsigned long op, ...)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), read, - (int fd, void *buffer, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count)) + (int fd, void *buffer, size_t count)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), read_pos, - (int fd, _haiku_build_off_t pos, void *buffer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count)) + (int fd, _haiku_build_off_t pos, void *buffer, size_t count)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), pread, - (int fd, void *buffer, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count, - _haiku_build_off_t pos)) + (int fd, void *buffer, size_t count, _haiku_build_off_t pos)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), write, - (int fd, const void *buffer, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count)) + (int fd, const void *buffer, size_t count)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), write_pos, - (int fd, _haiku_build_off_t pos, const void *buffer, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count)) + (int fd, _haiku_build_off_t pos, const void *buffer, size_t count)) _HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_IDENTIFIER(ssize_t), pwrite, - (int fd, const void *buffer, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ count, - _haiku_build_off_t pos)) + (int fd, const void *buffer, size_t count, _haiku_build_off_t pos)) _HAIKU_BUILD_DECLARE_FUNCTION(_haiku_build_off_t, lseek, (int fd, _haiku_build_off_t offset, int whence)) @@ -374,8 +368,8 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, getdtablesize, (void)) _HAIKU_BUILD_DECLARE_FUNCTION(long, sysconf, (int name)) _HAIKU_BUILD_DECLARE_FUNCTION(long, fpathconf, (int fd, int name)) _HAIKU_BUILD_DECLARE_FUNCTION(long, pathconf, (const char *path, int name)) -_HAIKU_BUILD_DECLARE_FUNCTION(_HAIKU_BUILD_FEATURE___SIZE_TYPE__, confstr, - (int name, char *buf, _HAIKU_BUILD_FEATURE___SIZE_TYPE__ len)) +_HAIKU_BUILD_DECLARE_FUNCTION(size_t, confstr, + (int name, char *buf, size_t len)) _HAIKU_BUILD_DECLARE_FUNCTION(int, lockf, (int fd, int function, _haiku_build_off_t size)) @@ -452,20 +446,19 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, setgroups, (int groupCount, const _haiku_build_gid_t* groupList)) _HAIKU_BUILD_DECLARE_FUNCTION(char*, getlogin, (void)) -_HAIKU_BUILD_DECLARE_FUNCTION(int, getlogin_r, (char *name, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ nameSize)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, getlogin_r, (char *name, size_t nameSize)) /* host name */ _HAIKU_BUILD_DECLARE_FUNCTION(int, sethostname, (const char *hostName, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ nameSize)) + size_t nameSize)) _HAIKU_BUILD_DECLARE_FUNCTION(int, gethostname, (char *hostName, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ nameSize)) + size_t nameSize)) /* tty */ _HAIKU_BUILD_DECLARE_FUNCTION(int, isatty, (int fd)) _HAIKU_BUILD_DECLARE_FUNCTION(char*, ttyname, (int fd)) _HAIKU_BUILD_DECLARE_FUNCTION(int, ttyname_r, (int fd, char *buffer, - _HAIKU_BUILD_FEATURE___SIZE_TYPE__ bufferSize)) + size_t bufferSize)) /* misc */ _HAIKU_BUILD_DECLARE_FUNCTION(char*, crypt, (const char *key, ############################################################################ Commit: 9b2dc9260590f74f745ef15c5bb2d2a0753cde3e Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 12:30:49 2012 UTC Re-add #include stddef.h ---------------------------------------------------------------------------- diff --git a/headers/build/posix_target/target_size_t.h b/headers/build/posix_target/target_size_t.h index 9b0cb41..7c65b4f 100644 --- a/headers/build/posix_target/target_size_t.h +++ b/headers/build/posix_target/target_size_t.h @@ -5,6 +5,8 @@ #ifndef _SIZE_T_H_ #define _SIZE_T_H_ +#include <stddef.h> + /* ATM we don't define ssize_t for GCC2 */ #if __GNUC__ > 2 && !defined(_HAIKU_BUILD_ssize_t__) diff --git a/headers/build/posix_target/target_wchar_t.h b/headers/build/posix_target/target_wchar_t.h index 83acab5..4022042 100644 --- a/headers/build/posix_target/target_wchar_t.h +++ b/headers/build/posix_target/target_wchar_t.h @@ -6,4 +6,4 @@ /* Include GCC's stddef.h. It defines wchar_t. */ /* NOTE: Included by HaikuHostBuildConfig.h */ -//#include <stddef.h> +#include <stddef.h> ############################################################################ Commit: 989de4d94aa6b73cdec4908b99c45cf426c06c48 Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 12:38:39 2012 UTC Pass definitions of _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 For now only atomic.cpp, byteorder.cpp and find_directory.cpp have _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 defined. Uncertain if SubDirCcFlags, SubDirC++Flags can have it instead. ---------------------------------------------------------------------------- diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile index c50eaf4..6fbb567 100644 --- a/src/build/libroot/Jamfile +++ b/src/build/libroot/Jamfile @@ -22,6 +22,7 @@ UsePrivateBuildHeaders kernel system ; defines = [ FDefines HAIKU_BUILD_GENERATED_DIRECTORY="\\\"$(HAIKU_OUTPUT_DIR)\\\"" + _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 ] ; ObjectC++Flags find_directory.cpp : $(defines) ; @@ -36,6 +37,7 @@ UsePrivateBuildHeaders kernel system ; defines = [ FDefines _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 ] ; ObjectC++Flags atomic.cpp : $(defines) ; + ObjectC++Flags byteorder.cpp : $(defines) ; } # locate the library ############################################################################ Commit: 128e3675595d54564cc99c20c07ed65f21e167be Author: Matt Madia <mattmadia@xxxxxxxxx> Date: Fri Aug 10 12:43:25 2012 UTC Add prefixes/macros for struct stat and stat(). ---------------------------------------------------------------------------- diff --git a/headers/build/posix_target/sys/target_stat.h b/headers/build/posix_target/sys/target_stat.h index 1839fc9..70ff9b9 100644 --- a/headers/build/posix_target/sys/target_stat.h +++ b/headers/build/posix_target/sys/target_stat.h @@ -10,8 +10,7 @@ #include <target_time.h> -// TODO: #8730 -- how to handle 'stat'? -struct stat { +struct _HAIKU_BUILD_IDENTIFIER(stat) { _haiku_build_dev_t st_dev; /* device ID that this file resides on */ _haiku_build_ino_t st_ino; /* this file's serial inode ID */ _haiku_build_mode_t st_mode; /* file mode (rwx for user, group, etc) */ @@ -115,12 +114,11 @@ _HAIKU_BUILD_DECLARE_FUNCTION(int, chmod, _HAIKU_BUILD_DECLARE_FUNCTION(int, fchmod, (int fd, _haiku_build_mode_t mode)) _HAIKU_BUILD_DECLARE_FUNCTION(int, fchmodat, (int fd, const char *path, _haiku_build_mode_t mode, int flag)) -// TODO: #8730 -- how to handle 'stat'? -_HAIKU_BUILD_DECLARE_FUNCTION(int, stat, (const char *path, struct stat *st)) -_HAIKU_BUILD_DECLARE_FUNCTION(int, fstat, (int fd, struct stat *st)) -_HAIKU_BUILD_DECLARE_FUNCTION(int, lstat, (const char *path, struct stat *st)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, stat, (const char *path, struct _HAIKU_BUILD_IDENTIFIER(stat) *st)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, fstat, (int fd, struct _HAIKU_BUILD_IDENTIFIER(stat) *st)) +_HAIKU_BUILD_DECLARE_FUNCTION(int, lstat, (const char *path, struct _HAIKU_BUILD_IDENTIFIER(stat) *st)) _HAIKU_BUILD_DECLARE_FUNCTION(int, fstatat, - (int fd, const char *path, struct stat *st, int flag)) + (int fd, const char *path, struct _HAIKU_BUILD_IDENTIFIER(stat) *st, int flag)) _HAIKU_BUILD_DECLARE_FUNCTION(int, mkdir, (const char *path, _haiku_build_mode_t mode)) _HAIKU_BUILD_DECLARE_FUNCTION(int, mkdirat, diff --git a/src/build/libroot/find_directory.cpp b/src/build/libroot/find_directory.cpp index bd86032..2c285ec 100644 --- a/src/build/libroot/find_directory.cpp +++ b/src/build/libroot/find_directory.cpp @@ -36,8 +36,7 @@ create_path(const char *path, _haiku_build_mode_t mode) while (++i < pathLength) { const char *slash = _haiku_build_strchr(&path[i], '/'); - // TODO: #8730 -- how to handle 'stat'? - struct stat st; + struct _HAIKU_BUILD_IDENTIFIER(stat) st; if (slash == _HAIKU_BUILD_NULL) i = pathLength; @@ -47,7 +46,7 @@ create_path(const char *path, _haiku_build_mode_t mode) continue; _haiku_build_strlcpy(buffer, path, i + 1); - if (stat(buffer, &st) < 0) { + if (_haiku_build_stat(buffer, &st) < 0) { _haiku_build_errno = 0; if (_haiku_build_mkdir(buffer, mode) < 0) return _haiku_build_errno; @@ -87,9 +86,8 @@ find_directory(_HAIKU_BUILD_IDENTIFIER(directory_which) which, // create, if necessary _haiku_build_status_t error = _HAIKU_BUILD_B_OK; - // TODO: #8730 -- how to handle 'stat'? - struct stat st; - if (createIt && stat(path, &st) < 0) + struct _HAIKU_BUILD_IDENTIFIER(stat) st; + if (createIt && _haiku_build_stat(path, &st) < 0) error = create_path(path, 0755); if (error == _HAIKU_BUILD_B_OK)