Ticket #8730: full-host-abstraction.diff
File full-host-abstraction.diff, 150.2 KB (added by , 12 years ago) |
---|
-
build/jam/BuildSetup
commit 525b0d3fcdfe93004014cdb978f703ae84e71d5b Author: Ingo Weinhold <ingo_weinhold@gmx.de> Date: Fri Feb 10 19:40:27 2012 +0100 Stash work in progress diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 41e72a2..63bfea2 100644
a b if $(HOST_PLATFORM_BEOS_COMPATIBLE) { 773 773 HOST_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ; 774 774 } else { 775 775 HOST_LIBSTDC++ = stdc++ ; 776 HOST_LIBROOT = libroot_build _function_remapper.a libroot_build.so ;777 HOST_STATIC_LIBROOT = libroot_build _function_remapper.a libroot_build.a ;776 HOST_LIBROOT = libroot_build.so ; 777 HOST_STATIC_LIBROOT = libroot_build.a ; 778 778 HOST_LIBBE = libbe_build.so ; 779 779 if $(HOST_PLATFORM) = cygwin { 780 780 HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR … … HOST_BE_API_C++FLAGS = ; 897 897 898 898 if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) { 899 899 HOST_BE_API_HEADERS = 900 [ FDirName $(HAIKU_BUILD_OUTPUT_DIR) ] 900 901 [ FDirName $(HAIKU_TOP) headers build ] 902 [ FDirName $(HAIKU_TOP) headers build posix ] 901 903 [ FDirName $(HAIKU_TOP) headers build os ] 902 904 [ FDirName $(HAIKU_TOP) headers build os app ] 903 905 [ FDirName $(HAIKU_TOP) headers build os drivers ] … … if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) { 908 910 [ FDirName $(HAIKU_TOP) headers build os support ] 909 911 [ FDirName $(HAIKU_TOP) headers build private ] 910 912 ; 911 HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ; 913 # HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ; 914 HOST_BE_API_CCFLAGS += -nostdinc ; 912 915 HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ; 916 HOST_BE_API_C++FLAGS += -nostdinc++ ; 913 917 } 914 918 915 919 # Add directory with system headers we need when building something for the host -
configure
diff --git a/configure b/configure index 3caedf2..57ce800 100755
a b cat << EOF > "$buildOutputDir/libgccObjects" 581 581 HAIKU_GCC_LIBGCC_OBJECTS ?= ${HAIKU_GCC_LIBGCC_OBJECTS} ; 582 582 EOF 583 583 584 # Generate a boot 584 # Generate a bootstrap Jamfile in the output directory. 585 585 586 586 cat << EOF > $outputDir/Jamfile 587 587 # automatically generated Jamfile … … HAIKU_OUTPUT_DIR = ${outputDir} ; 592 592 include [ FDirName \$(HAIKU_TOP) Jamfile ] ; 593 593 594 594 EOF 595 596 597 598 # hostFeaturesFile=$outputDir/build/HostFeatures 599 # rm -f "$hostFeaturesFile" 600 # touch "$hostFeaturesFile" 601 # jam -a configure_build 602 # 603 # hostBuildConfigHeader=$outputDir/build/HaikuHostBuildConfig.h 604 # rm -f "$hostBuildConfigHeader" 605 # echo >> "$buildConfigFile" 606 # for feature in `cat $hostFeaturesFile`; do 607 # echo "#define _HAIKU_HOST_FEATURE_$feature 1" >> "$hostBuildConfigHeader" 608 # echo "HAIKU_HOST_FEATURE_$feature = 1 ;" >> "$buildConfigFile" 609 # done 610 611 612 613 hostBuildConfigHeader=$outputDir/build/HaikuHostBuildConfig.h 614 cat << EOF > "$hostBuildConfigHeader" 615 /* auto-generated by configure */ 616 #ifndef _HAIKU_BUILD_HOST_BUILD_CONFIG_H 617 #define _HAIKU_BUILD_HOST_BUILD_CONFIG_H 618 EOF 619 620 jam -a configure_build 621 622 cat << EOF >> "$hostBuildConfigHeader" 623 #endif /* _HAIKU_BUILD_HOST_BUILD_CONFIG_H */ 624 EOF 625 626 627 echo >> "$buildConfigFile" 628 cat "$hostBuildConfigHeader" | grep "#define _HAIKU_BUILD_FEATURE_" \ 629 | sed -e 's@#define _\(HAIKU_BUILD_FEATURE_[^[:space:]]*\)[[:space:]]*\(.*\)@\1 = \2 ;@' \ 630 >> "$buildConfigFile" -
new file headers/build/HaikuBuild.h
diff --git a/headers/build/HaikuBuild.h b/headers/build/HaikuBuild.h new file mode 100644 index 0000000..044bf7a
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_H 6 #define _HAIKU_BUILD_H 7 8 9 #include <HaikuHostBuildConfig.h> 10 11 12 #define _HAIKU_BUILD_STRING(string) 13 #define _HAIKU_BUILD_ASMNAME(name) \ 14 _HAIKU_BUILD_STRING(__USER_LABEL_PREFIX__) name 15 16 17 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 18 # define _HAIKU_BUILD_DECLARE_FUNCTION(returnValue, name, parameters) \ 19 returnValue _haiku_build_##name parameters; 20 #else 21 # define _HAIKU_BUILD_DECLARE_FUNCTION(returnValue, name, parameters) \ 22 returnValue _haiku_build_##name parameters; \ 23 returnValue name parameters \ 24 __asm__(_HAIKU_BUILD_ASMNAME("_haiku_build_" #name)); 25 #endif 26 27 28 #endif /* _HAIKU_BUILD_H */ -
headers/build/config_build/HaikuConfig.h
diff --git a/headers/build/config_build/HaikuConfig.h b/headers/build/config_build/HaikuConfig.h index 8d49522..91e5509 100644
a b 1 1 /* 2 * Copyright 2009-201 0, Haiku, Inc. All Rights Reserved.2 * Copyright 2009-2011, Haiku, Inc. All Rights Reserved. 3 3 * Distributed under the terms of the MIT License. 4 4 */ 5 5 #ifndef _CONFIG_HAIKU_CONFIG_H 6 6 #define _CONFIG_HAIKU_CONFIG_H 7 7 8 8 9 #include <HaikuBuild.h> 10 11 9 12 /* Determine the architecture and define macros for some fundamental 10 13 properties: 11 14 __HAIKU_ARCH - short name of the architecture (used in paths) … … 18 21 (defaults to undefined) 19 22 */ 20 23 #ifdef __INTEL__ 21 # define __HAIKU_ ARCH x8622 # define __HAIKU_ ARCH_X86 124 # define __HAIKU_BUILD_HAIKU_ARCH x86 25 # define __HAIKU_BUILD_HAIKU_ARCH_X86 1 23 26 #elif __x86_64__ 24 # define __HAIKU_ ARCH x86_6425 # define __HAIKU_ ARCH_X86_64 126 # define __HAIKU_ ARCH_BITS 6427 # define __HAIKU_BUILD_HAIKU_ARCH x86_64 28 # define __HAIKU_BUILD_HAIKU_ARCH_X86_64 1 29 # define __HAIKU_BUILD_HAIKU_ARCH_BITS 64 27 30 #elif __POWERPC__ 28 # define __HAIKU_ ARCH ppc29 # define __HAIKU_ ARCH_PPC 130 # define __HAIKU_B IG_ENDIAN 131 # define __HAIKU_BUILD_HAIKU_ARCH ppc 32 # define __HAIKU_BUILD_HAIKU_ARCH_PPC 1 33 # define __HAIKU_BUILD_HAIKU_BIG_ENDIAN 1 31 34 #elif __M68K__ 32 # define __HAIKU_ ARCH m68k33 # define __HAIKU_ ARCH_M68K 134 # define __HAIKU_B IG_ENDIAN 135 # define __HAIKU_BUILD_HAIKU_ARCH m68k 36 # define __HAIKU_BUILD_HAIKU_ARCH_M68K 1 37 # define __HAIKU_BUILD_HAIKU_BIG_ENDIAN 1 35 38 #elif __MIPSEL__ 36 # define __HAIKU_ ARCH mipsel37 # define __HAIKU_ ARCH_MIPSEL 139 # define __HAIKU_BUILD_HAIKU_ARCH mipsel 40 # define __HAIKU_BUILD_HAIKU_ARCH_MIPSEL 1 38 41 #elif __ARM__ 39 # define __HAIKU_ ARCH arm40 # define __HAIKU_ ARCH_ARM 142 # define __HAIKU_BUILD_HAIKU_ARCH arm 43 # define __HAIKU_BUILD_HAIKU_ARCH_ARM 1 41 44 #else 42 45 # error Unsupported architecture! 43 46 #endif … … 53 56 */ 54 57 55 58 /* bitness */ 56 #ifndef __HAIKU_ ARCH_BITS57 # define __HAIKU_ ARCH_BITS 3259 #ifndef __HAIKU_BUILD_HAIKU_ARCH_BITS 60 # define __HAIKU_BUILD_HAIKU_ARCH_BITS 32 58 61 #endif 59 62 60 #if __HAIKU_ ARCH_BITS == 3261 # define __HAIKU_ ARCH_32_BIT 162 #elif __HAIKU_ ARCH_BITS == 6463 # define __HAIKU_ ARCH_64_BIT 163 #if __HAIKU_BUILD_HAIKU_ARCH_BITS == 32 64 # define __HAIKU_BUILD_HAIKU_ARCH_32_BIT 1 65 #elif __HAIKU_BUILD_HAIKU_ARCH_BITS == 64 66 # define __HAIKU_BUILD_HAIKU_ARCH_64_BIT 1 64 67 #else 65 68 # error Unsupported bitness! 66 69 #endif 67 70 68 71 /* physical bitness */ 69 #ifndef __HAIKU_ARCH_PHYSICAL_BITS 70 # define __HAIKU_ARCH_PHYSICAL_BITS __HAIKU_ARCH_BITS 72 #ifndef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS 73 # define __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS \ 74 __HAIKU_BUILD_HAIKU_ARCH_BITS 71 75 #endif 72 76 73 #if __HAIKU_ ARCH_PHYSICAL_BITS == 3274 # define __HAIKU_ ARCH_PHYSICAL_32_BIT 175 #elif __HAIKU_ ARCH_PHYSICAL_BITS == 6476 # define __HAIKU_ ARCH_PHYSICAL_64_BIT 177 #if __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS == 32 78 # define __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_32_BIT 1 79 #elif __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS == 64 80 # define __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 1 77 81 #else 78 82 # error Unsupported physical bitness! 79 83 #endif 80 84 81 85 /* endianess */ 82 #ifndef __HAIKU_B IG_ENDIAN83 # define __HAIKU_ LITTLE_ENDIAN 186 #ifndef __HAIKU_BUILD_HAIKU_BIG_ENDIAN 87 # define __HAIKU_BUILD_HAIKU_LITTLE_ENDIAN 1 84 88 #endif 85 89 86 90 /* architecture specific include macros */ 87 #define __HAIKU_ARCH_HEADER(header) <arch/__HAIKU_ARCH/header> 91 #define __HAIKU_BUILD_HAIKU_ARCH_HEADER(header) <arch/__HAIKU_ARCH/header> 92 #define __HAIKU_BUILD_HAIKU_SUBDIR_ARCH_HEADER(subdir, header) \ 93 <subdir/arch/__HAIKU_BUILD_HAIKU_ARCH/header> 94 95 96 /* map the macros, if not building the libroot mapper functions */ 97 98 #ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 99 100 #define __HAIKU_ARCH __HAIKU_BUILD_HAIKU_ARCH 101 #define __HAIKU_ARCH_BITS __HAIKU_BUILD_HAIKU_ARCH_BITS 102 #define __HAIKU_ARCH_PHYSICAL_BITS __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS 103 104 #ifdef __HAIKU_BUILD_HAIKU_ARCH_X86 105 # define __HAIKU_ARCH_X86 __HAIKU_BUILD_HAIKU_ARCH_X86 106 #endif 107 108 #ifdef __HAIKU_BUILD_HAIKU_ARCH_X86_64 109 # define __HAIKU_ARCH_X86_64 __HAIKU_BUILD_HAIKU_ARCH_X86_64 110 #endif 111 112 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PPC 113 # define __HAIKU_ARCH_PPC __HAIKU_BUILD_HAIKU_ARCH_PPC 114 #endif 115 116 #ifdef __HAIKU_BUILD_HAIKU_ARCH_M68K 117 # define __HAIKU_ARCH_M68K __HAIKU_BUILD_HAIKU_ARCH_M68K 118 #endif 119 120 #ifdef __HAIKU_BUILD_HAIKU_ARCH_MIPSEL 121 # define __HAIKU_ARCH_MIPSEL __HAIKU_BUILD_HAIKU_ARCH_MIPSEL 122 #endif 123 124 #ifdef __HAIKU_BUILD_HAIKU_ARCH_ARM 125 # define __HAIKU_ARCH_ARM __HAIKU_BUILD_HAIKU_ARCH_ARM 126 #endif 127 128 #ifdef __HAIKU_BUILD_HAIKU_ARCH_32_BIT 129 # define __HAIKU_ARCH_32_BIT __HAIKU_BUILD_HAIKU_ARCH_32_BIT 130 #endif 131 132 #ifdef __HAIKU_BUILD_HAIKU_ARCH_64_BIT 133 # define __HAIKU_ARCH_64_BIT __HAIKU_BUILD_HAIKU_ARCH_64_BIT 134 #endif 135 136 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_32_BIT 137 # define __HAIKU_ARCH_PHYSICAL_32_BIT __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_32_BIT 138 #endif 139 140 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 141 # define __HAIKU_ARCH_PHYSICAL_64_BIT __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 142 #endif 143 144 #ifdef __HAIKU_BUILD_HAIKU_ARCH_LITTLE_ENDIAN 145 # define __HAIKU_ARCH_LITTLE_ENDIAN __HAIKU_BUILD_HAIKU_ARCH_LITTLE_ENDIAN 146 #endif 147 148 #ifdef __HAIKU_BUILD_HAIKU_ARCH_BIG_ENDIAN 149 # define __HAIKU_ARCH_BIG_ENDIAN __HAIKU_BUILD_HAIKU_ARCH_BIG_ENDIAN 150 #endif 151 152 153 #define __HAIKU_ARCH_HEADER(header) __HAIKU_BUILD_HAIKU_ARCH_HEADER(header) 88 154 #define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header) \ 89 <subdir/arch/__HAIKU_ARCH/header>155 __HAIKU_BUILD_HAIKU_SUBDIR_ARCH_HEADER(subdir, header) 90 156 157 #endif /* _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER */ 91 158 92 159 #endif /* _CONFIG_HAIKU_CONFIG_H */ -
headers/build/config_build/types.h
diff --git a/headers/build/config_build/types.h b/headers/build/config_build/types.h index 960e1ce..53da55d 100644
a b 6 6 #define _CONFIG_BUILD_TYPES_H 7 7 8 8 9 #include < config_build/HaikuConfig.h>9 #include <HaikuBuild.h> 10 10 11 #include < inttypes.h>11 #include <config_build/HaikuConfig.h> 12 12 13 13 14 14 /* fixed-width types -- the __haiku_std_[u]int* types correspond to the POSIX … … 16 16 __HAIKU_BEOS_COMPATIBLE_TYPES is not defined both sets are identical. Once 17 17 we drop compatibility for good, we can consolidate the types. 18 18 */ 19 typedef int8_t __haiku_std_int8;20 typedef uint8_t __haiku_std_uint8;21 typedef int16_t __haiku_std_int16;22 typedef uint16_t __haiku_std_uint16;23 typedef int32_t __haiku_std_int32;24 typedef uint32_t __haiku_std_uint32;25 typedef int64_t __haiku_std_int64;26 typedef uint64_t __haiku_std_uint64;27 28 typedef __haiku_ std_int8 __haiku_int8;29 typedef __haiku_ std_uint8 __haiku_uint8;30 typedef __haiku_ std_int16 __haiku_int16;31 typedef __haiku_ std_uint16 __haiku_uint16;32 typedef __haiku_ std_int32 __haiku_int32;33 typedef __haiku_ std_uint32 __haiku_uint32;34 typedef __haiku_ std_int64 __haiku_int64;35 typedef __haiku_ std_uint64 __haiku_uint64;19 typedef _HAIKU_BUILD_FEATURE_int8 __haiku_build_haiku_std_int8; 20 typedef _HAIKU_BUILD_FEATURE_uint8 __haiku_build_haiku_std_uint8; 21 typedef _HAIKU_BUILD_FEATURE_int16 __haiku_build_haiku_std_int16; 22 typedef _HAIKU_BUILD_FEATURE_uint16 __haiku_build_haiku_std_uint16; 23 typedef _HAIKU_BUILD_FEATURE_int32 __haiku_build_haiku_std_int32; 24 typedef _HAIKU_BUILD_FEATURE_uint32 __haiku_build_haiku_std_uint32; 25 typedef _HAIKU_BUILD_FEATURE_int64 __haiku_build_haiku_std_int64; 26 typedef _HAIKU_BUILD_FEATURE_uint64 __haiku_build_haiku_std_uint64; 27 28 typedef __haiku_build_haiku_std_int8 __haiku_build_haiku_int8; 29 typedef __haiku_build_haiku_std_uint8 __haiku_build_haiku_uint8; 30 typedef __haiku_build_haiku_std_int16 __haiku_build_haiku_int16; 31 typedef __haiku_build_haiku_std_uint16 __haiku_build_haiku_uint16; 32 typedef __haiku_build_haiku_std_int32 __haiku_build_haiku_int32; 33 typedef __haiku_build_haiku_std_uint32 __haiku_build_haiku_uint32; 34 typedef __haiku_build_haiku_std_int64 __haiku_build_haiku_int64; 35 typedef __haiku_build_haiku_std_uint64 __haiku_build_haiku_uint64; 36 36 37 37 /* address types */ 38 #ifdef __HAIKU_ ARCH_64_BIT39 typedef __haiku_ int64 __haiku_saddr_t;40 typedef __haiku_ uint64 __haiku_addr_t;38 #ifdef __HAIKU_BUILD_HAIKU_ARCH_64_BIT 39 typedef __haiku_build_haiku_int64 __haiku_build_haiku_saddr_t; 40 typedef __haiku_build_haiku_uint64 __haiku_build_haiku_addr_t; 41 41 #else 42 typedef __haiku_ int32 __haiku_saddr_t;43 typedef __haiku_ uint32 __haiku_addr_t;42 typedef __haiku_build_haiku_int32 __haiku_build_haiku_saddr_t; 43 typedef __haiku_build_haiku_uint32 __haiku_build_haiku_addr_t; 44 44 #endif 45 45 46 #ifdef __HAIKU_ ARCH_PHYSICAL_64_BIT47 typedef __haiku_ int64 __haiku_phys_saddr_t;48 typedef __haiku_ uint64 __haiku_phys_addr_t;46 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 47 typedef __haiku_build_haiku_int64 __haiku_build_haiku_phys_saddr_t; 48 typedef __haiku_build_haiku_uint64 __haiku_build_haiku_phys_addr_t; 49 49 #else 50 typedef __haiku_ int32 __haiku_phys_saddr_t;51 typedef __haiku_ uint32 __haiku_phys_addr_t;50 typedef __haiku_build_haiku_int32 __haiku_build_haiku_phys_saddr_t; 51 typedef __haiku_build_haiku_uint32 __haiku_build_haiku_phys_addr_t; 52 52 #endif 53 53 54 54 /* address type limits */ 55 #ifdef __HAIKU_ ARCH_64_BIT56 # define __HAIKU_ SADDR_MAX (9223372036854775807LL)57 # define __HAIKU_ ADDR_MAX (18446744073709551615ULL)55 #ifdef __HAIKU_BUILD_HAIKU_ARCH_64_BIT 56 # define __HAIKU_BUILD_HAIKU_SADDR_MAX (9223372036854775807LL) 57 # define __HAIKU_BUILD_HAIKU_ADDR_MAX (18446744073709551615ULL) 58 58 #else 59 # define __HAIKU_ SADDR_MAX (2147483647)60 # define __HAIKU_ ADDR_MAX (4294967295U)59 # define __HAIKU_BUILD_HAIKU_SADDR_MAX (2147483647) 60 # define __HAIKU_BUILD_HAIKU_ADDR_MAX (4294967295U) 61 61 #endif 62 #define __HAIKU_ SADDR_MIN (-__HAIKU_SADDR_MAX-1)62 #define __HAIKU_BUILD_HAIKU_SADDR_MIN (-__HAIKU_BUILD_HAIKU_SADDR_MAX-1) 63 63 64 #ifdef __HAIKU_ ARCH_PHYSICAL_64_BIT65 # define __HAIKU_ PHYS_SADDR_MAX (9223372036854775807LL)66 # define __HAIKU_ PHYS_ADDR_MAX (18446744073709551615ULL)64 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 65 # define __HAIKU_BUILD_HAIKU_PHYS_SADDR_MAX (9223372036854775807LL) 66 # define __HAIKU_BUILD_HAIKU_PHYS_ADDR_MAX (18446744073709551615ULL) 67 67 #else 68 # define __HAIKU_ PHYS_SADDR_MAX (2147483647)69 # define __HAIKU_ PHYS_ADDR_MAX (4294967295U)68 # define __HAIKU_BUILD_HAIKU_PHYS_SADDR_MAX (2147483647) 69 # define __HAIKU_BUILD_HAIKU_PHYS_ADDR_MAX (4294967295U) 70 70 #endif 71 #define __HAIKU_ PHYS_SADDR_MIN (-__HAIKU_SADDR_MAX-1)71 #define __HAIKU_BUILD_HAIKU_PHYS_SADDR_MIN (-__HAIKU_BUILD_HAIKU_SADDR_MAX-1) 72 72 73 73 74 74 /* printf()/scanf() format prefixes */ 75 /* TODO: The following are only guesses! We should define them in the 76 build/host headers. */ 77 #define __HAIKU_STD_PRI_PREFIX_32 "" 78 #ifdef __HAIKU_ARCH_64_BIT 79 # define __HAIKU_STD_PRI_PREFIX_64 "l" 75 #define __HAIKU_BUILD_HAIKU_STD_PRI_PREFIX_32 \ 76 _HAIKU_BUILD_FEATURE_FORMAT_PREFIX_int32 77 #define __HAIKU_BUILD_HAIKU_STD_PRI_PREFIX_64 \ 78 _HAIKU_BUILD_FEATURE_FORMAT_PREFIX_int64 79 80 #define __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 \ 81 __HAIKU_BUILD_HAIKU_STD_PRI_PREFIX_32 82 #define __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 \ 83 __HAIKU_BUILD_HAIKU_STD_PRI_PREFIX_64 84 85 #ifdef __HAIKU_BUILD_HAIKU_ARCH_64_BIT 86 # define __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR \ 87 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 80 88 #else 81 # define __HAIKU_STD_PRI_PREFIX_64 "ll" 89 # define __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR \ 90 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 82 91 #endif 83 92 84 #define __HAIKU_PRI_PREFIX_32 __HAIKU_STD_PRI_PREFIX_32 85 #define __HAIKU_PRI_PREFIX_64 __HAIKU_STD_PRI_PREFIX_64 86 87 #ifdef __HAIKU_ARCH_64_BIT 88 # define __HAIKU_PRI_PREFIX_ADDR __HAIKU_PRI_PREFIX_64 93 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 94 # define __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR \ 95 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 89 96 #else 90 # define __HAIKU_PRI_PREFIX_ADDR __HAIKU_PRI_PREFIX_32 91 #endif 92 93 #ifdef __HAIKU_ARCH_PHYSICAL_64_BIT 94 # define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_64 95 #else 96 # define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_32 97 # define __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR \ 98 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 97 99 #endif 98 100 99 101 100 102 /* a generic address type wide enough for virtual and physical addresses */ 101 #if __HAIKU_ARCH_BITS >= __HAIKU_ARCH_PHYSICAL_BITS 102 typedef __haiku_addr_t __haiku_generic_addr_t; 103 # define __HAIKU_GENERIC_ADDR_MAX __HAIKU_ADDR_MAX 104 # define __HAIKU_PRI_PREFIX_GENERIC_ADDR __HAIKU_PRI_PREFIX_ADDR 103 #if __HAIKU_BUILD_HAIKU_ARCH_BITS >= __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS 104 typedef __haiku_build_haiku_addr_t __haiku_build_haiku_generic_addr_t; 105 # define __HAIKU_BUILD_HAIKU_GENERIC_ADDR_MAX \ 106 __HAIKU_BUILD_HAIKU_ADDR_MAX 107 # define __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR \ 108 __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR 105 109 #else 106 typedef __haiku_phys_addr_t __haiku_generic_addr_t; 107 # define __HAIKU_GENERIC_ADDR_MAX __HAIKU_PHYS_ADDR_MAX 108 # define __HAIKU_PRI_PREFIX_GENERIC_ADDR __HAIKU_PRI_PREFIX_PHYS_ADDR 110 typedef __haiku_build_haiku_phys_addr_t __haiku_build_haiku_generic_addr_t; 111 # define __HAIKU_BUILD_HAIKU_GENERIC_ADDR_MAX \ 112 __HAIKU_BUILD_HAIKU_PHYS_ADDR_MAX 113 # define __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR \ 114 __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR 109 115 #endif 110 116 111 117 118 /* map the macros/types, if not building the libroot mapper functions */ 119 120 #ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 121 122 typedef __haiku_build_haiku_std_int8 __haiku_std_int8; 123 typedef __haiku_build_haiku_std_uint8 __haiku_std_uint8; 124 typedef __haiku_build_haiku_std_int16 __haiku_std_int16; 125 typedef __haiku_build_haiku_std_uint16 __haiku_std_uint16; 126 typedef __haiku_build_haiku_std_int32 __haiku_std_int32; 127 typedef __haiku_build_haiku_std_uint32 __haiku_std_uint32; 128 typedef __haiku_build_haiku_std_int64 __haiku_std_int64; 129 typedef __haiku_build_haiku_std_uint64 __haiku_std_uint64; 130 131 typedef __haiku_build_haiku_int8 __haiku_int8; 132 typedef __haiku_build_haiku_uint8 __haiku_uint8; 133 typedef __haiku_build_haiku_int16 __haiku_int16; 134 typedef __haiku_build_haiku_uint16 __haiku_uint16; 135 typedef __haiku_build_haiku_int32 __haiku_int32; 136 typedef __haiku_build_haiku_uint32 __haiku_uint32; 137 typedef __haiku_build_haiku_int64 __haiku_int64; 138 typedef __haiku_build_haiku_uint64 __haiku_uint64; 139 140 typedef __haiku_build_haiku_saddr_t __haiku_saddr_t; 141 typedef __haiku_build_haiku_addr_t __haiku_addr_t; 142 typedef __haiku_build_haiku_phys_saddr_t __haiku_phys_saddr_t; 143 typedef __haiku_build_haiku_phys_addr_t __haiku_phys_addr_t; 144 145 #define __HAIKU_SADDR_MAX __HAIKU_BUILD_HAIKU_SADDR_MAX 146 #define __HAIKU_ADDR_MAX __HAIKU_BUILD_HAIKU_ADDR_MAX 147 #define __HAIKU_SADDR_MIN __HAIKU_BUILD_HAIKU_SADDR_MIN 148 149 #define __HAIKU_PHYS_SADDR_MAX __HAIKU_BUILD_HAIKU_PHYS_SADDR_MAX 150 #define __HAIKU_PHYS_ADDR_MAX __HAIKU_BUILD_HAIKU_PHYS_ADDR_MAX 151 #define __HAIKU_PHYS_SADDR_MIN __HAIKU_BUILD_HAIKU_PHYS_SADDR_MIN 152 153 #define __HAIKU_STD_PRI_PREFIX_32 __HAIKU_BUILD_HAIKU_STD_PRI_PREFIX_32 154 #define __HAIKU_STD_PRI_PREFIX_64 __HAIKU_BUILD_HAIKU_STD_PRI_PREFIX_64 155 156 #define __HAIKU_PRI_PREFIX_32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 157 #define __HAIKU_PRI_PREFIX_64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 158 159 #define __HAIKU_PRI_PREFIX_ADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR 160 #define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR 161 162 typedef __haiku_build_haiku_generic_addr_t __haiku_generic_addr_t; 163 #define __HAIKU_GENERIC_ADDR_MAX __HAIKU_BUILD_HAIKU_GENERIC_ADDR_MAX 164 #define __HAIKU_PRI_PREFIX_GENERIC_ADDR \ 165 __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR 166 167 #endif /* _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER */ 168 112 169 #endif /* _CONFIG_BUILD_TYPES_H */ -
headers/build/os/BeBuild.h
diff --git a/headers/build/os/BeBuild.h b/headers/build/os/BeBuild.h index 3130e03..6c34e0d 100644
a b 2 2 * Copyright 2007-2010, Haiku, Inc. All Rights Reserved. 3 3 * Distributed under the terms of the MIT License. 4 4 */ 5 #ifndef _ BE_BUILD_H6 #define _ BE_BUILD_H5 #ifndef _HAIKU_BUILD_BE_BUILD_H 6 #define _HAIKU_BUILD_BE_BUILD_H 7 7 8 8 9 9 #include <config_build/HaikuConfig.h> 10 10 11 11 12 #define B_BEOS_VERSION_4 0x040013 #define B_BEOS_VERSION_4_5 0x045014 #define B_BEOS_VERSION_5 0x050012 #define HAIKU_BUILD_B_BEOS_VERSION_4 0x0400 13 #define HAIKU_BUILD_B_BEOS_VERSION_4_5 0x0450 14 #define HAIKU_BUILD_B_BEOS_VERSION_5 0x0500 15 15 16 #define B_BEOS_VERSIONB_BEOS_VERSION_517 #define B_BEOS_VERSION_MAUIB_BEOS_VERSION_516 #define HAIKU_BUILD_B_BEOS_VERSION HAIKU_BUILD_B_BEOS_VERSION_5 17 #define HAIKU_BUILD_B_BEOS_VERSION_MAUI HAIKU_BUILD_B_BEOS_VERSION_5 18 18 19 19 /* Haiku (API) version */ 20 #define B_HAIKU_VERSION_BEOS 0x0000000121 #define B_HAIKU_VERSION_BONE 0x0000000222 #define B_HAIKU_VERSION_DANO 0x0000000323 #define B_HAIKU_VERSION_1_ALPHA_1 0x0000010024 #define B_HAIKU_VERSION_1_PRE_ALPHA_2 0x0000010125 #define B_HAIKU_VERSION_1 0x0001000020 #define HAIKU_BUILD_B_HAIKU_VERSION_BEOS 0x00000001 21 #define HAIKU_BUILD_B_HAIKU_VERSION_BONE 0x00000002 22 #define HAIKU_BUILD_B_HAIKU_VERSION_DANO 0x00000003 23 #define HAIKU_BUILD_B_HAIKU_VERSION_1_ALPHA_1 0x00000100 24 #define HAIKU_BUILD_B_HAIKU_VERSION_1_PRE_ALPHA_2 0x00000101 25 #define HAIKU_BUILD_B_HAIKU_VERSION_1 0x00010000 26 26 27 #define B_HAIKU_VERSION B_HAIKU_VERSION_1_PRE_ALPHA_2 27 #define HAIKU_BUILD_B_HAIKU_VERSION \ 28 HAIKU_BUILD_B_HAIKU_VERSION_1_PRE_ALPHA_2 28 29 29 30 /* Haiku ABI */ 30 #define B_HAIKU_ABI_MAJOR 0xffff000031 #define B_HAIKU_ABI_GCC_2 0x0002000032 #define B_HAIKU_ABI_GCC_4 0x0004000031 #define HAIKU_BUILD_B_HAIKU_ABI_MAJOR 0xffff0000 32 #define HAIKU_BUILD_B_HAIKU_ABI_GCC_2 0x00020000 33 #define HAIKU_BUILD_B_HAIKU_ABI_GCC_4 0x00040000 33 34 34 #define B_HAIKU_ABI_GCC_2_ANCIENT 0x0002000035 #define B_HAIKU_ABI_GCC_2_BEOS 0x0002000136 #define B_HAIKU_ABI_GCC_2_HAIKU 0x0002000235 #define HAIKU_BUILD_B_HAIKU_ABI_GCC_2_ANCIENT 0x00020000 36 #define HAIKU_BUILD_B_HAIKU_ABI_GCC_2_BEOS 0x00020001 37 #define HAIKU_BUILD_B_HAIKU_ABI_GCC_2_HAIKU 0x00020002 37 38 38 39 #if __GNUC__ == 2 39 # define B_HAIKU_ABI B_HAIKU_ABI_GCC_2_HAIKU 40 # define HAIKU_BUILD_B_HAIKU_ABI \ 41 HAIKU_BUILD_B_HAIKU_ABI_GCC_2_HAIKU 40 42 #elif __GNUC__ == 3 || __GNUC__ == 4 41 # define B_HAIKU_ABI B_HAIKU_ABI_GCC_4 43 # define HAIKU_BUILD_B_HAIKU_ABI \ 44 HAIKU_BUILD_B_HAIKU_ABI_GCC_4 42 45 #else 43 46 # error Unsupported gcc version! 44 47 #endif 45 48 46 49 47 #define B_HAIKU_BITS __HAIKU_ARCH_BITS 48 #define B_HAIKU_PHYSICAL_BITS __HAIKU_ARCH_PHYSICAL_BITS 50 #define HAIKU_BUILD_B_HAIKU_BITS \ 51 __HAIKU_BUILD_HAIKU_ARCH_BITS 52 #define HAIKU_BUILD_B_HAIKU_PHYSICAL_BITS \ 53 __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_BITS 49 54 50 #ifdef __HAIKU_ ARCH_64_BIT51 # define B_HAIKU_64_BIT 155 #ifdef __HAIKU_BUILD_HAIKU_ARCH_64_BIT 56 # define HAIKU_BUILD_B_HAIKU_64_BIT 1 52 57 #else 53 # define B_HAIKU_32_BIT 158 # define HAIKU_BUILD_B_HAIKU_32_BIT 1 54 59 #endif 55 60 56 #ifdef __HAIKU_ ARCH_PHYSICAL_64_BIT57 # define B_HAIKU_PHYSICAL_64_BIT 161 #ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT 62 # define HAIKU_BUILD_B_HAIKU_PHYSICAL_64_BIT 1 58 63 #else 59 # define B_HAIKU_PHYSICAL_32_BIT 164 # define HAIKU_BUILD_B_HAIKU_PHYSICAL_32_BIT 1 60 65 #endif 61 66 62 #ifdef __HAIKU_B EOS_COMPATIBLE63 # define B_HAIKU_BEOS_COMPATIBLE 167 #ifdef __HAIKU_BUILD_HAIKU_BEOS_COMPATIBLE 68 # define HAIKU_BUILD_B_HAIKU_BEOS_COMPATIBLE 1 64 69 #endif 65 70 66 71 67 #define _ UNUSED(argument) argument68 #define _ PACKED __attribute__((packed))69 #define _ PRINTFLIKE(_format_, _args_) \72 #define _HAIKU_BUILD_UNUSED(argument) argument 73 #define _HAIKU_BUILD_PACKED __attribute__((packed)) 74 #define _HAIKU_BUILD_PRINTFLIKE(_format_, _args_) \ 70 75 __attribute__((format(__printf__, _format_, _args_))) 71 #define _ EXPORT72 #define _ IMPORT76 #define _HAIKU_BUILD_EXPORT 77 #define _HAIKU_BUILD_IMPORT 73 78 74 79 #define B_DEFINE_SYMBOL_VERSION(function, versionedSymbol) \ 75 80 __asm__(".symver " function "," versionedSymbol) 76 81 77 82 78 #define _ IMPEXP_ROOT79 #define _ IMPEXP_BE83 #define _HAIKU_BUILD_IMPEXP_ROOT 84 #define _HAIKU_BUILD_IMPEXP_BE 80 85 81 86 82 #endif /* _ BE_BUILD_H */87 #endif /* _HAIKU_BUILD_BE_BUILD_H */ -
headers/build/os/storage/FindDirectory.h
diff --git a/headers/build/os/storage/FindDirectory.h b/headers/build/os/storage/FindDirectory.h index 96124a9..83721e2 100644
a b 1 #include <../os/storage/FindDirectory.h> 1 /* 2 * Copyright 2002-2009, Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_FIND_DIRECTORY_H 6 #define _HAIKU_BUILD_FIND_DIRECTORY_H 7 8 9 #include <HaikuBuild.h> 10 11 #include <SupportDefs.h> 12 13 14 typedef enum { 15 /* Per volume directories */ 16 HAIKU_BUILD_B_DESKTOP_DIRECTORY = 0, 17 HAIKU_BUILD_B_TRASH_DIRECTORY, 18 19 /* System directories */ 20 HAIKU_BUILD_B_SYSTEM_DIRECTORY = 1000, 21 HAIKU_BUILD_B_SYSTEM_ADDONS_DIRECTORY = 1002, 22 HAIKU_BUILD_B_SYSTEM_BOOT_DIRECTORY, 23 HAIKU_BUILD_B_SYSTEM_FONTS_DIRECTORY, 24 HAIKU_BUILD_B_SYSTEM_LIB_DIRECTORY, 25 HAIKU_BUILD_B_SYSTEM_SERVERS_DIRECTORY, 26 HAIKU_BUILD_B_SYSTEM_APPS_DIRECTORY, 27 HAIKU_BUILD_B_SYSTEM_BIN_DIRECTORY, 28 HAIKU_BUILD_B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010, 29 HAIKU_BUILD_B_SYSTEM_PREFERENCES_DIRECTORY, 30 HAIKU_BUILD_B_SYSTEM_TRANSLATORS_DIRECTORY, 31 HAIKU_BUILD_B_SYSTEM_MEDIA_NODES_DIRECTORY, 32 HAIKU_BUILD_B_SYSTEM_SOUNDS_DIRECTORY, 33 HAIKU_BUILD_B_SYSTEM_DATA_DIRECTORY, 34 HAIKU_BUILD_B_SYSTEM_DEVELOP_DIRECTORY, 35 HAIKU_BUILD_B_SYSTEM_PACKAGES_DIRECTORY, 36 HAIKU_BUILD_B_SYSTEM_HEADERS_DIRECTORY, 37 38 /* Common directories, shared among all users. */ 39 HAIKU_BUILD_B_COMMON_DIRECTORY = 2000, 40 HAIKU_BUILD_B_COMMON_SYSTEM_DIRECTORY, 41 HAIKU_BUILD_B_COMMON_ADDONS_DIRECTORY, 42 HAIKU_BUILD_B_COMMON_BOOT_DIRECTORY, 43 HAIKU_BUILD_B_COMMON_FONTS_DIRECTORY, 44 HAIKU_BUILD_B_COMMON_LIB_DIRECTORY, 45 HAIKU_BUILD_B_COMMON_SERVERS_DIRECTORY, 46 HAIKU_BUILD_B_COMMON_BIN_DIRECTORY, 47 HAIKU_BUILD_B_COMMON_ETC_DIRECTORY, 48 HAIKU_BUILD_B_COMMON_DOCUMENTATION_DIRECTORY, 49 HAIKU_BUILD_B_COMMON_SETTINGS_DIRECTORY, 50 HAIKU_BUILD_B_COMMON_DEVELOP_DIRECTORY, 51 HAIKU_BUILD_B_COMMON_LOG_DIRECTORY, 52 HAIKU_BUILD_B_COMMON_SPOOL_DIRECTORY, 53 HAIKU_BUILD_B_COMMON_TEMP_DIRECTORY, 54 HAIKU_BUILD_B_COMMON_VAR_DIRECTORY, 55 HAIKU_BUILD_B_COMMON_TRANSLATORS_DIRECTORY, 56 HAIKU_BUILD_B_COMMON_MEDIA_NODES_DIRECTORY, 57 HAIKU_BUILD_B_COMMON_SOUNDS_DIRECTORY, 58 HAIKU_BUILD_B_COMMON_DATA_DIRECTORY, 59 HAIKU_BUILD_B_COMMON_CACHE_DIRECTORY, 60 HAIKU_BUILD_B_COMMON_PACKAGES_DIRECTORY, 61 HAIKU_BUILD_B_COMMON_HEADERS_DIRECTORY, 62 HAIKU_BUILD_B_COMMON_NONPACKAGED_DIRECTORY, 63 HAIKU_BUILD_B_COMMON_NONPACKAGED_ADDONS_DIRECTORY, 64 HAIKU_BUILD_B_COMMON_NONPACKAGED_TRANSLATORS_DIRECTORY, 65 HAIKU_BUILD_B_COMMON_NONPACKAGED_MEDIA_NODES_DIRECTORY, 66 HAIKU_BUILD_B_COMMON_NONPACKAGED_BIN_DIRECTORY, 67 HAIKU_BUILD_B_COMMON_NONPACKAGED_DATA_DIRECTORY, 68 HAIKU_BUILD_B_COMMON_NONPACKAGED_FONTS_DIRECTORY, 69 HAIKU_BUILD_B_COMMON_NONPACKAGED_SOUNDS_DIRECTORY, 70 HAIKU_BUILD_B_COMMON_NONPACKAGED_DOCUMENTATION_DIRECTORY, 71 HAIKU_BUILD_B_COMMON_NONPACKAGED_LIB_DIRECTORY, 72 HAIKU_BUILD_B_COMMON_NONPACKAGED_HEADERS_DIRECTORY, 73 74 /* User directories. These are interpreted in the context 75 of the user making the find_directory call. */ 76 HAIKU_BUILD_B_USER_DIRECTORY = 3000, 77 HAIKU_BUILD_B_USER_CONFIG_DIRECTORY, 78 HAIKU_BUILD_B_USER_ADDONS_DIRECTORY, 79 HAIKU_BUILD_B_USER_BOOT_DIRECTORY, 80 HAIKU_BUILD_B_USER_FONTS_DIRECTORY, 81 HAIKU_BUILD_B_USER_LIB_DIRECTORY, 82 HAIKU_BUILD_B_USER_SETTINGS_DIRECTORY, 83 HAIKU_BUILD_B_USER_DESKBAR_DIRECTORY, 84 HAIKU_BUILD_B_USER_PRINTERS_DIRECTORY, 85 HAIKU_BUILD_B_USER_TRANSLATORS_DIRECTORY, 86 HAIKU_BUILD_B_USER_MEDIA_NODES_DIRECTORY, 87 HAIKU_BUILD_B_USER_SOUNDS_DIRECTORY, 88 HAIKU_BUILD_B_USER_DATA_DIRECTORY, 89 HAIKU_BUILD_B_USER_CACHE_DIRECTORY, 90 HAIKU_BUILD_B_USER_PACKAGES_DIRECTORY, 91 HAIKU_BUILD_B_USER_HEADERS_DIRECTORY, 92 HAIKU_BUILD_B_USER_NONPACKAGED_DIRECTORY, 93 HAIKU_BUILD_B_USER_NONPACKAGED_ADDONS_DIRECTORY, 94 HAIKU_BUILD_B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY, 95 HAIKU_BUILD_B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY, 96 HAIKU_BUILD_B_USER_NONPACKAGED_BIN_DIRECTORY, 97 HAIKU_BUILD_B_USER_NONPACKAGED_DATA_DIRECTORY, 98 HAIKU_BUILD_B_USER_NONPACKAGED_FONTS_DIRECTORY, 99 HAIKU_BUILD_B_USER_NONPACKAGED_SOUNDS_DIRECTORY, 100 HAIKU_BUILD_B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY, 101 HAIKU_BUILD_B_USER_NONPACKAGED_LIB_DIRECTORY, 102 HAIKU_BUILD_B_USER_NONPACKAGED_HEADERS_DIRECTORY, 103 104 /* Global directories. */ 105 HAIKU_BUILD_B_APPS_DIRECTORY = 4000, 106 HAIKU_BUILD_B_PREFERENCES_DIRECTORY, 107 HAIKU_BUILD_B_UTILITIES_DIRECTORY, 108 HAIKU_BUILD_B_PACKAGE_LINKS_DIRECTORY, 109 110 /* Obsolete: Legacy BeOS definition to be phased out */ 111 HAIKU_BUILD_B_BEOS_DIRECTORY = 1000, 112 HAIKU_BUILD_B_BEOS_SYSTEM_DIRECTORY, 113 HAIKU_BUILD_B_BEOS_ADDONS_DIRECTORY, 114 HAIKU_BUILD_B_BEOS_BOOT_DIRECTORY, 115 HAIKU_BUILD_B_BEOS_FONTS_DIRECTORY, 116 HAIKU_BUILD_B_BEOS_LIB_DIRECTORY, 117 HAIKU_BUILD_B_BEOS_SERVERS_DIRECTORY, 118 HAIKU_BUILD_B_BEOS_APPS_DIRECTORY, 119 HAIKU_BUILD_B_BEOS_BIN_DIRECTORY, 120 HAIKU_BUILD_B_BEOS_ETC_DIRECTORY, 121 HAIKU_BUILD_B_BEOS_DOCUMENTATION_DIRECTORY, 122 HAIKU_BUILD_B_BEOS_PREFERENCES_DIRECTORY, 123 HAIKU_BUILD_B_BEOS_TRANSLATORS_DIRECTORY, 124 HAIKU_BUILD_B_BEOS_MEDIA_NODES_DIRECTORY, 125 HAIKU_BUILD_B_BEOS_SOUNDS_DIRECTORY, 126 HAIKU_BUILD_B_BEOS_DATA_DIRECTORY, 127 } haiku_build_directory_which; 128 129 #ifdef __cplusplus 130 extern "C" { 131 #endif 132 133 /* C interface */ 134 135 _HAIKU_BUILD_DECLARE_FUNCTION( 136 status_t, find_directory, 137 (directory_which which, dev_t volume, bool createIt, 138 char* pathString, int32 length)) 139 140 #ifdef __cplusplus 141 } 142 #endif 143 144 145 #ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 146 147 #define B_DESKTOP_DIRECTORY HAIKU_BUILD_B_DESKTOP_DIRECTORY 148 #define B_TRASH_DIRECTORY HAIKU_BUILD_B_TRASH_DIRECTORY 149 150 #define B_SYSTEM_DIRECTORY HAIKU_BUILD_B_SYSTEM_DIRECTORY 151 #define B_SYSTEM_ADDONS_DIRECTORY HAIKU_BUILD_B_SYSTEM_ADDONS_DIRECTORY 152 #define B_SYSTEM_BOOT_DIRECTORY HAIKU_BUILD_B_SYSTEM_BOOT_DIRECTORY 153 #define B_SYSTEM_FONTS_DIRECTORY HAIKU_BUILD_B_SYSTEM_FONTS_DIRECTORY 154 #define B_SYSTEM_LIB_DIRECTORY HAIKU_BUILD_B_SYSTEM_LIB_DIRECTORY 155 #define B_SYSTEM_SERVERS_DIRECTORY HAIKU_BUILD_B_SYSTEM_SERVERS_DIRECTORY 156 #define B_SYSTEM_APPS_DIRECTORY HAIKU_BUILD_B_SYSTEM_APPS_DIRECTORY 157 #define B_SYSTEM_BIN_DIRECTORY HAIKU_BUILD_B_SYSTEM_BIN_DIRECTORY 158 #define B_SYSTEM_DOCUMENTATION_DIRECTORY HAIKU_BUILD_B_SYSTEM_DOCUMENTATION_DIRECTORY 159 #define B_SYSTEM_PREFERENCES_DIRECTORY HAIKU_BUILD_B_SYSTEM_PREFERENCES_DIRECTORY 160 #define B_SYSTEM_TRANSLATORS_DIRECTORY HAIKU_BUILD_B_SYSTEM_TRANSLATORS_DIRECTORY 161 #define B_SYSTEM_MEDIA_NODES_DIRECTORY HAIKU_BUILD_B_SYSTEM_MEDIA_NODES_DIRECTORY 162 #define B_SYSTEM_SOUNDS_DIRECTORY HAIKU_BUILD_B_SYSTEM_SOUNDS_DIRECTORY 163 #define B_SYSTEM_DATA_DIRECTORY HAIKU_BUILD_B_SYSTEM_DATA_DIRECTORY 164 #define B_SYSTEM_DEVELOP_DIRECTORY HAIKU_BUILD_B_SYSTEM_DEVELOP_DIRECTORY 165 #define B_SYSTEM_PACKAGES_DIRECTORY HAIKU_BUILD_B_SYSTEM_PACKAGES_DIRECTORY 166 #define B_SYSTEM_HEADERS_DIRECTORY HAIKU_BUILD_B_SYSTEM_HEADERS_DIRECTORY 167 168 #define B_COMMON_DIRECTORY HAIKU_BUILD_B_COMMON_DIRECTORY 169 #define B_COMMON_SYSTEM_DIRECTORY HAIKU_BUILD_B_COMMON_SYSTEM_DIRECTORY 170 #define B_COMMON_ADDONS_DIRECTORY HAIKU_BUILD_B_COMMON_ADDONS_DIRECTORY 171 #define B_COMMON_BOOT_DIRECTORY HAIKU_BUILD_B_COMMON_BOOT_DIRECTORY 172 #define B_COMMON_FONTS_DIRECTORY HAIKU_BUILD_B_COMMON_FONTS_DIRECTORY 173 #define B_COMMON_LIB_DIRECTORY HAIKU_BUILD_B_COMMON_LIB_DIRECTORY 174 #define B_COMMON_SERVERS_DIRECTORY HAIKU_BUILD_B_COMMON_SERVERS_DIRECTORY 175 #define B_COMMON_BIN_DIRECTORY HAIKU_BUILD_B_COMMON_BIN_DIRECTORY 176 #define B_COMMON_ETC_DIRECTORY HAIKU_BUILD_B_COMMON_ETC_DIRECTORY 177 #define B_COMMON_DOCUMENTATION_DIRECTORY HAIKU_BUILD_B_COMMON_DOCUMENTATION_DIRECTORY 178 #define B_COMMON_SETTINGS_DIRECTORY HAIKU_BUILD_B_COMMON_SETTINGS_DIRECTORY 179 #define B_COMMON_DEVELOP_DIRECTORY HAIKU_BUILD_B_COMMON_DEVELOP_DIRECTORY 180 #define B_COMMON_LOG_DIRECTORY HAIKU_BUILD_B_COMMON_LOG_DIRECTORY 181 #define B_COMMON_SPOOL_DIRECTORY HAIKU_BUILD_B_COMMON_SPOOL_DIRECTORY 182 #define B_COMMON_TEMP_DIRECTORY HAIKU_BUILD_B_COMMON_TEMP_DIRECTORY 183 #define B_COMMON_VAR_DIRECTORY HAIKU_BUILD_B_COMMON_VAR_DIRECTORY 184 #define B_COMMON_TRANSLATORS_DIRECTORY HAIKU_BUILD_B_COMMON_TRANSLATORS_DIRECTORY 185 #define B_COMMON_MEDIA_NODES_DIRECTORY HAIKU_BUILD_B_COMMON_MEDIA_NODES_DIRECTORY 186 #define B_COMMON_SOUNDS_DIRECTORY HAIKU_BUILD_B_COMMON_SOUNDS_DIRECTORY 187 #define B_COMMON_DATA_DIRECTORY HAIKU_BUILD_B_COMMON_DATA_DIRECTORY 188 #define B_COMMON_CACHE_DIRECTORY HAIKU_BUILD_B_COMMON_CACHE_DIRECTORY 189 #define B_COMMON_PACKAGES_DIRECTORY HAIKU_BUILD_B_COMMON_PACKAGES_DIRECTORY 190 #define B_COMMON_HEADERS_DIRECTORY HAIKU_BUILD_B_COMMON_HEADERS_DIRECTORY 191 #define B_COMMON_NONPACKAGED_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_DIRECTORY 192 #define B_COMMON_NONPACKAGED_ADDONS_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_ADDONS_DIRECTORY 193 #define B_COMMON_NONPACKAGED_TRANSLATORS_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_TRANSLATORS_DIRECTORY 194 #define B_COMMON_NONPACKAGED_MEDIA_NODES_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_MEDIA_NODES_DIRECTORY 195 #define B_COMMON_NONPACKAGED_BIN_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_BIN_DIRECTORY 196 #define B_COMMON_NONPACKAGED_DATA_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_DATA_DIRECTORY 197 #define B_COMMON_NONPACKAGED_FONTS_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_FONTS_DIRECTORY 198 #define B_COMMON_NONPACKAGED_SOUNDS_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_SOUNDS_DIRECTORY 199 #define B_COMMON_NONPACKAGED_DOCUMENTATION_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_DOCUMENTATION_DIRECTORY 200 #define B_COMMON_NONPACKAGED_LIB_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_LIB_DIRECTORY 201 #define B_COMMON_NONPACKAGED_HEADERS_DIRECTORY HAIKU_BUILD_B_COMMON_NONPACKAGED_HEADERS_DIRECTORY 202 203 #define B_USER_DIRECTORY HAIKU_BUILD_B_USER_DIRECTORY 204 #define B_USER_CONFIG_DIRECTORY HAIKU_BUILD_B_USER_CONFIG_DIRECTORY 205 #define B_USER_ADDONS_DIRECTORY HAIKU_BUILD_B_USER_ADDONS_DIRECTORY 206 #define B_USER_BOOT_DIRECTORY HAIKU_BUILD_B_USER_BOOT_DIRECTORY 207 #define B_USER_FONTS_DIRECTORY HAIKU_BUILD_B_USER_FONTS_DIRECTORY 208 #define B_USER_LIB_DIRECTORY HAIKU_BUILD_B_USER_LIB_DIRECTORY 209 #define B_USER_SETTINGS_DIRECTORY HAIKU_BUILD_B_USER_SETTINGS_DIRECTORY 210 #define B_USER_DESKBAR_DIRECTORY HAIKU_BUILD_B_USER_DESKBAR_DIRECTORY 211 #define B_USER_PRINTERS_DIRECTORY HAIKU_BUILD_B_USER_PRINTERS_DIRECTORY 212 #define B_USER_TRANSLATORS_DIRECTORY HAIKU_BUILD_B_USER_TRANSLATORS_DIRECTORY 213 #define B_USER_MEDIA_NODES_DIRECTORY HAIKU_BUILD_B_USER_MEDIA_NODES_DIRECTORY 214 #define B_USER_SOUNDS_DIRECTORY HAIKU_BUILD_B_USER_SOUNDS_DIRECTORY 215 #define B_USER_DATA_DIRECTORY HAIKU_BUILD_B_USER_DATA_DIRECTORY 216 #define B_USER_CACHE_DIRECTORY HAIKU_BUILD_B_USER_CACHE_DIRECTORY 217 #define B_USER_PACKAGES_DIRECTORY HAIKU_BUILD_B_USER_PACKAGES_DIRECTORY 218 #define B_USER_HEADERS_DIRECTORY HAIKU_BUILD_B_USER_HEADERS_DIRECTORY 219 #define B_USER_NONPACKAGED_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_DIRECTORY 220 #define B_USER_NONPACKAGED_ADDONS_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_ADDONS_DIRECTORY 221 #define B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY 222 #define B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY 223 #define B_USER_NONPACKAGED_BIN_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_BIN_DIRECTORY 224 #define B_USER_NONPACKAGED_DATA_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_DATA_DIRECTORY 225 #define B_USER_NONPACKAGED_FONTS_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_FONTS_DIRECTORY 226 #define B_USER_NONPACKAGED_SOUNDS_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_SOUNDS_DIRECTORY 227 #define B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY 228 #define B_USER_NONPACKAGED_LIB_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_LIB_DIRECTORY 229 #define B_USER_NONPACKAGED_HEADERS_DIRECTORY HAIKU_BUILD_B_USER_NONPACKAGED_HEADERS_DIRECTORY 230 231 #define B_APPS_DIRECTORY HAIKU_BUILD_B_APPS_DIRECTORY 232 #define B_PREFERENCES_DIRECTORY HAIKU_BUILD_B_PREFERENCES_DIRECTORY 233 #define B_UTILITIES_DIRECTORY HAIKU_BUILD_B_UTILITIES_DIRECTORY 234 #define B_PACKAGE_LINKS_DIRECTORY HAIKU_BUILD_B_PACKAGE_LINKS_DIRECTORY 235 236 #define B_BEOS_DIRECTORY HAIKU_BUILD_B_BEOS_DIRECTORY 237 #define B_BEOS_SYSTEM_DIRECTORY HAIKU_BUILD_B_BEOS_SYSTEM_DIRECTORY 238 #define B_BEOS_ADDONS_DIRECTORY HAIKU_BUILD_B_BEOS_ADDONS_DIRECTORY 239 #define B_BEOS_BOOT_DIRECTORY HAIKU_BUILD_B_BEOS_BOOT_DIRECTORY 240 #define B_BEOS_FONTS_DIRECTORY HAIKU_BUILD_B_BEOS_FONTS_DIRECTORY 241 #define B_BEOS_LIB_DIRECTORY HAIKU_BUILD_B_BEOS_LIB_DIRECTORY 242 #define B_BEOS_SERVERS_DIRECTORY HAIKU_BUILD_B_BEOS_SERVERS_DIRECTORY 243 #define B_BEOS_APPS_DIRECTORY HAIKU_BUILD_B_BEOS_APPS_DIRECTORY 244 #define B_BEOS_BIN_DIRECTORY HAIKU_BUILD_B_BEOS_BIN_DIRECTORY 245 #define B_BEOS_ETC_DIRECTORY HAIKU_BUILD_B_BEOS_ETC_DIRECTORY 246 #define B_BEOS_DOCUMENTATION_DIRECTORY HAIKU_BUILD_B_BEOS_DOCUMENTATION_DIRECTORY 247 #define B_BEOS_PREFERENCES_DIRECTORY HAIKU_BUILD_B_BEOS_PREFERENCES_DIRECTORY 248 #define B_BEOS_TRANSLATORS_DIRECTORY HAIKU_BUILD_B_BEOS_TRANSLATORS_DIRECTORY 249 #define B_BEOS_MEDIA_NODES_DIRECTORY HAIKU_BUILD_B_BEOS_MEDIA_NODES_DIRECTORY 250 #define B_BEOS_SOUNDS_DIRECTORY HAIKU_BUILD_B_BEOS_SOUNDS_DIRECTORY 251 #define B_BEOS_DATA_DIRECTORY HAIKU_BUILD_B_BEOS_DATA_DIRECTORY 252 253 typedef haiku_build_directory_which directory_which; 254 255 256 /* C++ interface */ 257 258 #ifdef __cplusplus 259 260 class BVolume; 261 class BPath; 262 263 status_t find_directory(directory_which which, BPath* path, 264 bool createIt = false, BVolume* volume = NULL); 265 266 #endif /* __cplusplus */ 267 268 #endif // ! _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 269 270 #endif /* _HAIKU_BUILD_FIND_DIRECTORY_H */ -
headers/build/os/support/ByteOrder.h
diff --git a/headers/build/os/support/ByteOrder.h b/headers/build/os/support/ByteOrder.h index ea63f6d..933378f 100644
a b 1 #include <../os/support/ByteOrder.h> 1 /* 2 * Copyright 2007-2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_BYTEORDER_H 6 #define _HAIKU_BUILD_BYTEORDER_H 7 8 9 #include <BeBuild.h> 10 #include <endian.h> 11 #include <SupportDefs.h> 12 #include <TypeConstants.h> 13 /* for convenience */ 14 15 16 /* swap directions */ 17 typedef enum { 18 HAIKU_BUILD_B_SWAP_HOST_TO_LENDIAN, 19 HAIKU_BUILD_B_SWAP_HOST_TO_BENDIAN, 20 HAIKU_BUILD_B_SWAP_LENDIAN_TO_HOST, 21 HAIKU_BUILD_B_SWAP_BENDIAN_TO_HOST, 22 HAIKU_BUILD_B_SWAP_ALWAYS 23 } haiku_build_swap_action; 24 25 26 /* BSD/networking macros */ 27 #ifndef haiku_build_htonl 28 # define haiku_build_htonl(x) HAIKU_BUILD_B_HOST_TO_BENDIAN_INT32(x) 29 # define haiku_build_ntohl(x) HAIKU_BUILD_B_BENDIAN_TO_HOST_INT32(x) 30 # define haiku_build_htons(x) HAIKU_BUILD_B_HOST_TO_BENDIAN_INT16(x) 31 # define haiku_build_ntohs(x) HAIKU_BUILD_B_BENDIAN_TO_HOST_INT16(x) 32 #endif 33 34 /* always swap macros */ 35 #define HAIKU_BUILD_B_SWAP_DOUBLE(arg) __haiku_build_swap_double(arg) 36 #define HAIKU_BUILD_B_SWAP_FLOAT(arg) __haiku_build_swap_float(arg) 37 #define HAIKU_BUILD_B_SWAP_INT64(arg) __haiku_build_swap_int64(arg) 38 #define HAIKU_BUILD_B_SWAP_INT32(arg) __haiku_build_swap_int32(arg) 39 #define HAIKU_BUILD_B_SWAP_INT16(arg) __haiku_build_swap_int16(arg) 40 41 #if HAIKU_BUILD_BYTE_ORDER == __LITTLE_ENDIAN 42 /* Host is little endian */ 43 44 #define HAIKU_BUILD_B_HOST_IS_LENDIAN 1 45 #define HAIKU_BUILD_B_HOST_IS_BENDIAN 0 46 47 /* Host native to little endian */ 48 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_DOUBLE(arg) (double)(arg) 49 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_FLOAT(arg) (float)(arg) 50 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_INT64(arg) (haiku_build_uint64)(arg) 51 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_INT32(arg) (haiku_build_uint32)(arg) 52 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_INT16(arg) (haiku_build_uint16)(arg) 53 54 /* Little endian to host native */ 55 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_DOUBLE(arg) (double)(arg) 56 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_FLOAT(arg) (float)(arg) 57 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_INT64(arg) (haiku_build_uint64)(arg) 58 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_INT32(arg) (haiku_build_uint32)(arg) 59 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_INT16(arg) (haiku_build_uint16)(arg) 60 61 /* Host native to big endian */ 62 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_DOUBLE(arg) \ 63 __haiku_build_swap_double(arg) 64 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_FLOAT(arg) \ 65 __haiku_build_swap_float(arg) 66 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_INT64(arg) \ 67 __haiku_build_swap_int64(arg) 68 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_INT32(arg) \ 69 __haiku_build_swap_int32(arg) 70 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_INT16(arg) \ 71 __haiku_build_swap_int16(arg) 72 73 /* Big endian to host native */ 74 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_DOUBLE(arg) \ 75 __haiku_build_swap_double(arg) 76 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_FLOAT(arg) \ 77 __haiku_build_swap_float(arg) 78 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_INT64(arg) \ 79 __haiku_build_swap_int64(arg) 80 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_INT32(arg) \ 81 __haiku_build_swap_int32(arg) 82 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_INT16(arg) \ 83 __haiku_build_swap_int16(arg) 84 85 #else /* BYTE_ORDER */ 86 /* Host is big endian */ 87 88 #define HAIKU_BUILD_B_HOST_IS_LENDIAN 0 89 #define HAIKU_BUILD_B_HOST_IS_BENDIAN 1 90 91 /* Host native to little endian */ 92 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_DOUBLE(arg) \ 93 __haiku_build_swap_double(arg) 94 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_FLOAT(arg) \ 95 __haiku_build_swap_float(arg) 96 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_INT64(arg) \ 97 __haiku_build_swap_int64(arg) 98 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_INT32(arg) \ 99 __haiku_build_swap_int32(arg) 100 #define HAIKU_BUILD_B_HOST_TO_LENDIAN_INT16(arg) \ 101 __haiku_build_swap_int16(arg) 102 103 /* Little endian to host native */ 104 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_DOUBLE(arg) \ 105 __haiku_build_swap_double(arg) 106 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_FLOAT(arg) \ 107 __haiku_build_swap_float(arg) 108 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_INT64(arg) \ 109 __haiku_build_swap_int64(arg) 110 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_INT32(arg) \ 111 __haiku_build_swap_int32(arg) 112 #define HAIKU_BUILD_B_LENDIAN_TO_HOST_INT16(arg) \ 113 __haiku_build_swap_int16(arg) 114 115 /* Host native to big endian */ 116 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_DOUBLE(arg) (double)(arg) 117 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_FLOAT(arg) (float)(arg) 118 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_INT64(arg) (haiku_build_uint64)(arg) 119 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_INT32(arg) (haiku_build_uint32)(arg) 120 #define HAIKU_BUILD_B_HOST_TO_BENDIAN_INT16(arg) (haiku_build_uint16)(arg) 121 122 /* Big endian to host native */ 123 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_DOUBLE(arg) (double)(arg) 124 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_FLOAT(arg) (float)(arg) 125 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_INT64(arg) (haiku_build_uint64)(arg) 126 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_INT32(arg) (haiku_build_uint32)(arg) 127 #define HAIKU_BUILD_B_BENDIAN_TO_HOST_INT16(arg) (haiku_build_uint16)(arg) 128 129 #endif /* BYTE_ORDER */ 130 131 132 #ifdef __cplusplus 133 extern "C" { 134 #endif 135 136 extern haiku_build_status_t haiku_build_swap_data(haiku_build_type_code type, 137 void *data, size_t length, haiku_build_swap_action action); 138 extern bool haiku_build_is_type_swapped(haiku_build_type_code type); 139 140 141 /* Private implementations */ 142 extern double __haiku_build_swap_double(double arg); 143 extern float __haiku_build_swap_float(float arg); 144 extern haiku_build_uint64 __haiku_build_swap_int64(haiku_build_uint64 arg); 145 extern haiku_build_uint32 __haiku_build_swap_int32(haiku_build_uint32 arg); 146 extern haiku_build_uint16 __haiku_build_swap_int16(haiku_build_uint16 arg); 147 148 #ifdef __cplusplus 149 } 150 #endif 151 152 #endif /* _HAIKU_BUILD_BYTEORDER_H */ -
headers/build/os/support/Errors.h
diff --git a/headers/build/os/support/Errors.h b/headers/build/os/support/Errors.h index 750a660..81321e2 100644
a b 1 /****************************************************************************** 2 / 3 / File: Errors.h 4 / 5 / Description: Error code constants. 6 / 7 / Copyright 1993-98, Be Incorporated 8 / 9 ******************************************************************************/ 1 /* 2 * Copyright 2007-2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_ERRORS_H 6 #define _HAIKU_BUILD_ERRORS_H 10 7 11 8 12 #ifndef _ERRORS_H13 #define _ERRORS_H14 15 #include <errno.h>16 9 #include <limits.h> 17 10 18 /*-------------------------------------------------------------*/ 19 /*----- Error baselines ---------------------------------------*/ 20 21 #define B_GENERAL_ERROR_BASE INT_MIN 22 #define B_OS_ERROR_BASE B_GENERAL_ERROR_BASE + 0x1000 23 #define B_APP_ERROR_BASE B_GENERAL_ERROR_BASE + 0x2000 24 #define B_INTERFACE_ERROR_BASE B_GENERAL_ERROR_BASE + 0x3000 25 #define B_MEDIA_ERROR_BASE B_GENERAL_ERROR_BASE + 0x4000 /* - 0x41ff */ 26 #define B_TRANSLATION_ERROR_BASE B_GENERAL_ERROR_BASE + 0x4800 /* - 0x48ff */ 27 #define B_MIDI_ERROR_BASE B_GENERAL_ERROR_BASE + 0x5000 28 #define B_STORAGE_ERROR_BASE B_GENERAL_ERROR_BASE + 0x6000 29 #define B_POSIX_ERROR_BASE B_GENERAL_ERROR_BASE + 0x7000 30 #define B_MAIL_ERROR_BASE B_GENERAL_ERROR_BASE + 0x8000 31 #define B_PRINT_ERROR_BASE B_GENERAL_ERROR_BASE + 0x9000 32 #define B_DEVICE_ERROR_BASE B_GENERAL_ERROR_BASE + 0xa000 33 34 /*--- Developer-defined errors start at (B_ERRORS_END+1)----*/ 35 36 #define B_ERRORS_END (B_GENERAL_ERROR_BASE + 0xffff) 37 38 39 /*-------------------------------------------------------------*/ 40 /*----- General Errors ----------------------------------------*/ 41 enum { 42 B_NO_MEMORY = B_GENERAL_ERROR_BASE, 43 B_IO_ERROR, 44 B_PERMISSION_DENIED, 45 B_BAD_INDEX, 46 B_BAD_TYPE, 47 B_BAD_VALUE, 48 B_MISMATCHED_VALUES, 49 B_NAME_NOT_FOUND, 50 B_NAME_IN_USE, 51 B_TIMED_OUT, 52 B_INTERRUPTED, 53 B_WOULD_BLOCK, 54 B_CANCELED, 55 B_NO_INIT, 56 B_BUSY, 57 B_NOT_ALLOWED, 58 B_BAD_DATA, 59 60 B_ERROR = -1, 61 B_OK = 0, 62 B_NO_ERROR = 0 63 }; 64 65 /*-------------------------------------------------------------*/ 66 /*----- Kernel Kit Errors -------------------------------------*/ 67 enum { 68 B_BAD_SEM_ID = B_OS_ERROR_BASE, 69 B_NO_MORE_SEMS, 70 71 B_BAD_THREAD_ID = B_OS_ERROR_BASE + 0x100, 72 B_NO_MORE_THREADS, 73 B_BAD_THREAD_STATE, 74 B_BAD_TEAM_ID, 75 B_NO_MORE_TEAMS, 76 77 B_BAD_PORT_ID = B_OS_ERROR_BASE + 0x200, 78 B_NO_MORE_PORTS, 79 80 B_BAD_IMAGE_ID = B_OS_ERROR_BASE + 0x300, 81 B_BAD_ADDRESS, 82 B_NOT_AN_EXECUTABLE, 83 B_MISSING_LIBRARY, 84 B_MISSING_SYMBOL, 85 86 B_DEBUGGER_ALREADY_INSTALLED = B_OS_ERROR_BASE + 0x400 87 }; 88 89 90 /*-------------------------------------------------------------*/ 91 /*----- Application Kit Errors --------------------------------*/ 92 enum 93 { 94 B_BAD_REPLY = B_APP_ERROR_BASE, 95 B_DUPLICATE_REPLY, 96 B_MESSAGE_TO_SELF, 97 B_BAD_HANDLER, 98 B_ALREADY_RUNNING, 99 B_LAUNCH_FAILED, 100 B_AMBIGUOUS_APP_LAUNCH, 101 B_UNKNOWN_MIME_TYPE, 102 B_BAD_SCRIPT_SYNTAX, 103 B_LAUNCH_FAILED_NO_RESOLVE_LINK, 104 B_LAUNCH_FAILED_EXECUTABLE, 105 B_LAUNCH_FAILED_APP_NOT_FOUND, 106 B_LAUNCH_FAILED_APP_IN_TRASH, 107 B_LAUNCH_FAILED_NO_PREFERRED_APP, 108 B_LAUNCH_FAILED_FILES_APP_NOT_FOUND, 109 B_BAD_MIME_SNIFFER_RULE, 110 B_NOT_A_MESSAGE, 111 B_SHUTDOWN_CANCELLED, 112 B_SHUTTING_DOWN 113 }; 114 115 116 /*-------------------------------------------------------------*/ 117 /*----- Storage Kit/File System Errors ------------------------*/ 118 enum { 119 B_FILE_ERROR = B_STORAGE_ERROR_BASE, 120 B_FILE_NOT_FOUND, /* discouraged; use B_ENTRY_NOT_FOUND in new code*/ 121 B_FILE_EXISTS, 122 B_ENTRY_NOT_FOUND, 123 B_NAME_TOO_LONG, 124 B_NOT_A_DIRECTORY, 125 B_DIRECTORY_NOT_EMPTY, 126 B_DEVICE_FULL, 127 B_READ_ONLY_DEVICE, 128 B_IS_A_DIRECTORY, 129 B_NO_MORE_FDS, 130 B_CROSS_DEVICE_LINK, 131 B_LINK_LIMIT, 132 B_BUSTED_PIPE, 133 B_UNSUPPORTED, 134 B_PARTITION_TOO_SMALL 135 }; 136 137 138 /*-------------------------------------------------------------*/ 139 /*----- POSIX Errors ------------------------------------------*/ 140 #define HAIKU_E2BIG (B_POSIX_ERROR_BASE + 1) 141 #define HAIKU_ECHILD (B_POSIX_ERROR_BASE + 2) 142 #define HAIKU_EDEADLK (B_POSIX_ERROR_BASE + 3) 143 #define HAIKU_EFBIG (B_POSIX_ERROR_BASE + 4) 144 #define HAIKU_EMLINK (B_POSIX_ERROR_BASE + 5) 145 #define HAIKU_ENFILE (B_POSIX_ERROR_BASE + 6) 146 #define HAIKU_ENODEV (B_POSIX_ERROR_BASE + 7) 147 #define HAIKU_ENOLCK (B_POSIX_ERROR_BASE + 8) 148 #define HAIKU_ENOSYS (B_POSIX_ERROR_BASE + 9) 149 #define HAIKU_ENOTTY (B_POSIX_ERROR_BASE + 10) 150 #define HAIKU_ENXIO (B_POSIX_ERROR_BASE + 11) 151 #define HAIKU_ESPIPE (B_POSIX_ERROR_BASE + 12) 152 #define HAIKU_ESRCH (B_POSIX_ERROR_BASE + 13) 153 #define HAIKU_EFPOS (B_POSIX_ERROR_BASE + 14) 154 #define HAIKU_ESIGPARM (B_POSIX_ERROR_BASE + 15) 155 #define HAIKU_EDOM (B_POSIX_ERROR_BASE + 16) 156 #define HAIKU_ERANGE (B_POSIX_ERROR_BASE + 17) 157 #define HAIKU_EPROTOTYPE (B_POSIX_ERROR_BASE + 18) 158 #define HAIKU_EPROTONOSUPPORT (B_POSIX_ERROR_BASE + 19) 159 #define HAIKU_EPFNOSUPPORT (B_POSIX_ERROR_BASE + 20) 160 #define HAIKU_EAFNOSUPPORT (B_POSIX_ERROR_BASE + 21) 161 #define HAIKU_EADDRINUSE (B_POSIX_ERROR_BASE + 22) 162 #define HAIKU_EADDRNOTAVAIL (B_POSIX_ERROR_BASE + 23) 163 #define HAIKU_ENETDOWN (B_POSIX_ERROR_BASE + 24) 164 #define HAIKU_ENETUNREACH (B_POSIX_ERROR_BASE + 25) 165 #define HAIKU_ENETRESET (B_POSIX_ERROR_BASE + 26) 166 #define HAIKU_ECONNABORTED (B_POSIX_ERROR_BASE + 27) 167 #define HAIKU_ECONNRESET (B_POSIX_ERROR_BASE + 28) 168 #define HAIKU_EISCONN (B_POSIX_ERROR_BASE + 29) 169 #define HAIKU_ENOTCONN (B_POSIX_ERROR_BASE + 30) 170 #define HAIKU_ESHUTDOWN (B_POSIX_ERROR_BASE + 31) 171 #define HAIKU_ECONNREFUSED (B_POSIX_ERROR_BASE + 32) 172 #define HAIKU_EHOSTUNREACH (B_POSIX_ERROR_BASE + 33) 173 #define HAIKU_ENOPROTOOPT (B_POSIX_ERROR_BASE + 34) 174 #define HAIKU_ENOBUFS (B_POSIX_ERROR_BASE + 35) 175 #define HAIKU_EINPROGRESS (B_POSIX_ERROR_BASE + 36) 176 #define HAIKU_EALREADY (B_POSIX_ERROR_BASE + 37) 177 #define HAIKU_EILSEQ (B_POSIX_ERROR_BASE + 38) 178 #define HAIKU_ENOMSG (B_POSIX_ERROR_BASE + 39) 179 #define HAIKU_ESTALE (B_POSIX_ERROR_BASE + 40) 180 #define HAIKU_EOVERFLOW (B_POSIX_ERROR_BASE + 41) 181 #define HAIKU_EMSGSIZE (B_POSIX_ERROR_BASE + 42) 182 #define HAIKU_EOPNOTSUPP (B_POSIX_ERROR_BASE + 43) 183 #define HAIKU_ENOTSOCK (B_POSIX_ERROR_BASE + 44) 184 #define HAIKU_EHOSTDOWN (B_POSIX_ERROR_BASE + 45) 185 #define HAIKU_EBADMSG (B_POSIX_ERROR_BASE + 46) 186 #define HAIKU_ECANCELED (B_POSIX_ERROR_BASE + 47) 187 #define HAIKU_EDESTADDRREQ (B_POSIX_ERROR_BASE + 48) 188 #define HAIKU_EDQUOT (B_POSIX_ERROR_BASE + 49) 189 #define HAIKU_EIDRM (B_POSIX_ERROR_BASE + 50) 190 #define HAIKU_EMULTIHOP (B_POSIX_ERROR_BASE + 51) 191 #define HAIKU_ENODATA (B_POSIX_ERROR_BASE + 52) 192 #define HAIKU_ENOLINK (B_POSIX_ERROR_BASE + 53) 193 #define HAIKU_ENOSR (B_POSIX_ERROR_BASE + 54) 194 #define HAIKU_ENOSTR (B_POSIX_ERROR_BASE + 55) 195 #define HAIKU_ENOTSUP (B_POSIX_ERROR_BASE + 56) 196 #define HAIKU_EPROTO (B_POSIX_ERROR_BASE + 57) 197 #define HAIKU_ETIME (B_POSIX_ERROR_BASE + 58) 198 #define HAIKU_ETXTBSY (B_POSIX_ERROR_BASE + 59) 199 #define HAIKU_ENOATTR (B_POSIX_ERROR_BASE + 60) 200 201 202 /*---- POSIX errors that can be mapped to BeOS error codes ----*/ 203 #define HAIKU_ENOMEM B_NO_MEMORY 204 #define HAIKU_EACCES B_PERMISSION_DENIED 205 #define HAIKU_EINTR B_INTERRUPTED 206 #define HAIKU_EIO B_IO_ERROR 207 #define HAIKU_EBUSY B_BUSY 208 #define HAIKU_EFAULT B_BAD_ADDRESS 209 #define HAIKU_ETIMEDOUT B_TIMED_OUT 210 #define HAIKU_EAGAIN B_WOULD_BLOCK /* SysV compatibility */ 211 #define HAIKU_EWOULDBLOCK B_WOULD_BLOCK /* BSD compatibility */ 212 #define HAIKU_EBADF B_FILE_ERROR 213 #define HAIKU_EEXIST B_FILE_EXISTS 214 #define HAIKU_EINVAL B_BAD_VALUE 215 #define HAIKU_ENAMETOOLONG B_NAME_TOO_LONG 216 #define HAIKU_ENOENT B_ENTRY_NOT_FOUND 217 #define HAIKU_EPERM B_NOT_ALLOWED 218 #define HAIKU_ENOTDIR B_NOT_A_DIRECTORY 219 #define HAIKU_EISDIR B_IS_A_DIRECTORY 220 #define HAIKU_ENOTEMPTY B_DIRECTORY_NOT_EMPTY 221 #define HAIKU_ENOSPC B_DEVICE_FULL 222 #define HAIKU_EROFS B_READ_ONLY_DEVICE 223 #define HAIKU_EMFILE B_NO_MORE_FDS 224 #define HAIKU_EXDEV B_CROSS_DEVICE_LINK 225 #define HAIKU_ELOOP B_LINK_LIMIT 226 #define HAIKU_ENOEXEC B_NOT_AN_EXECUTABLE 227 #define HAIKU_EPIPE B_BUSTED_PIPE 228 229 #ifndef BUILDING_HAIKU_ERROR_MAPPER 230 #undef E2BIG 231 #undef ECHILD 232 #undef EDEADLK 233 #undef EFBIG 234 #undef EMLINK 235 #undef ENFILE 236 #undef ENODEV 237 #undef ENOLCK 238 #undef ENOSYS 239 #undef ENOTTY 240 #undef ENXIO 241 #undef ESPIPE 242 #undef ESRCH 243 #undef EFPOS 244 #undef ESIGPARM 245 #undef EDOM 246 #undef ERANGE 247 #undef EPROTOTYPE 248 #undef EPROTONOSUPPORT 249 #undef EPFNOSUPPORT 250 #undef EAFNOSUPPORT 251 #undef EADDRINUSE 252 #undef EADDRNOTAVAIL 253 #undef ENETDOWN 254 #undef ENETUNREACH 255 #undef ENETRESET 256 #undef ECONNABORTED 257 #undef ECONNRESET 258 #undef EISCONN 259 #undef ENOTCONN 260 #undef ESHUTDOWN 261 #undef ECONNREFUSED 262 #undef EHOSTUNREACH 263 #undef ENOPROTOOPT 264 #undef ENOBUFS 265 #undef EINPROGRESS 266 #undef EALREADY 267 #undef EILSEQ 268 #undef ENOMSG 269 #undef ESTALE 270 #undef EOVERFLOW 271 #undef EMSGSIZE 272 #undef EOPNOTSUPP 273 #undef ENOTSOCK 274 #undef EHOSTDOWN 275 #undef EBADMSG 276 #undef ECANCELED 277 #undef EDESTADDRREQ 278 #undef EDQUOT 279 #undef EIDRM 280 #undef EMULTIHOP 281 #undef ENODATA 282 #undef ENOLINK 283 #undef ENOSR 284 #undef ENOSTR 285 #undef ENOTSUP 286 #undef EPROTO 287 #undef ETIME 288 #undef ETXTBSY 289 #undef ENOMEM 290 #undef EACCES 291 #undef EINTR 292 #undef EIO 293 #undef EBUSY 294 #undef EFAULT 295 #undef ETIMEDOUT 296 #undef EAGAIN 297 #undef EWOULDBLOCK 298 #undef EBADF 299 #undef EEXIST 300 #undef EINVAL 301 #undef ENAMETOOLONG 302 #undef ENOENT 303 #undef EPERM 304 #undef ENOTDIR 305 #undef EISDIR 306 #undef ENOTEMPTY 307 #undef ENOSPC 308 #undef EROFS 309 #undef EMFILE 310 #undef EXDEV 311 #undef ELOOP 312 #undef ENOEXEC 313 #undef EPIPE 314 #undef ENOATTR 315 316 #define E2BIG HAIKU_E2BIG 317 #define ECHILD HAIKU_ECHILD 318 #define EDEADLK HAIKU_EDEADLK 319 #define EFBIG HAIKU_EFBIG 320 #define EMLINK HAIKU_EMLINK 321 #define ENFILE HAIKU_ENFILE 322 #define ENODEV HAIKU_ENODEV 323 #define ENOLCK HAIKU_ENOLCK 324 #define ENOSYS HAIKU_ENOSYS 325 #define ENOTTY HAIKU_ENOTTY 326 #define ENXIO HAIKU_ENXIO 327 #define ESPIPE HAIKU_ESPIPE 328 #define ESRCH HAIKU_ESRCH 329 #define EFPOS HAIKU_EFPOS 330 #define ESIGPARM HAIKU_ESIGPARM 331 #define EDOM HAIKU_EDOM 332 #define ERANGE HAIKU_ERANGE 333 #define EPROTOTYPE HAIKU_EPROTOTYPE 334 #define EPROTONOSUPPORT HAIKU_EPROTONOSUPPORT 335 #define EPFNOSUPPORT HAIKU_EPFNOSUPPORT 336 #define EAFNOSUPPORT HAIKU_EAFNOSUPPORT 337 #define EADDRINUSE HAIKU_EADDRINUSE 338 #define EADDRNOTAVAIL HAIKU_EADDRNOTAVAIL 339 #define ENETDOWN HAIKU_ENETDOWN 340 #define ENETUNREACH HAIKU_ENETUNREACH 341 #define ENETRESET HAIKU_ENETRESET 342 #define ECONNABORTED HAIKU_ECONNABORTED 343 #define ECONNRESET HAIKU_ECONNRESET 344 #define EISCONN HAIKU_EISCONN 345 #define ENOTCONN HAIKU_ENOTCONN 346 #define ESHUTDOWN HAIKU_ESHUTDOWN 347 #define ECONNREFUSED HAIKU_ECONNREFUSED 348 #define EHOSTUNREACH HAIKU_EHOSTUNREACH 349 #define ENOPROTOOPT HAIKU_ENOPROTOOPT 350 #define ENOBUFS HAIKU_ENOBUFS 351 #define EINPROGRESS HAIKU_EINPROGRESS 352 #define EALREADY HAIKU_EALREADY 353 #define EILSEQ HAIKU_EILSEQ 354 #define ENOMSG HAIKU_ENOMSG 355 #define ESTALE HAIKU_ESTALE 356 #define EOVERFLOW HAIKU_EOVERFLOW 357 #define EMSGSIZE HAIKU_EMSGSIZE 358 #define EOPNOTSUPP HAIKU_EOPNOTSUPP 359 #define ENOTSOCK HAIKU_ENOTSOCK 360 #define EHOSTDOWN HAIKU_EHOSTDOWN 361 #define EBADMSG HAIKU_EBADMSG 362 #define ECANCELED HAIKU_ECANCELED 363 #define EDESTADDRREQ HAIKU_EDESTADDRREQ 364 #define EDQUOT HAIKU_EDQUOT 365 #define EIDRM HAIKU_EIDRM 366 #define EMULTIHOP HAIKU_EMULTIHOP 367 #define ENODATA HAIKU_ENODATA 368 #define ENOLINK HAIKU_ENOLINK 369 #define ENOSR HAIKU_ENOSR 370 #define ENOSTR HAIKU_ENOSTR 371 #define ENOTSUP HAIKU_ENOTSUP 372 #define EPROTO HAIKU_EPROTO 373 #define ETIME HAIKU_ETIME 374 #define ETXTBSY HAIKU_ETXTBSY 375 #define ENOMEM HAIKU_ENOMEM 376 #define EACCES HAIKU_EACCES 377 #define EINTR HAIKU_EINTR 378 #define EIO HAIKU_EIO 379 #define EBUSY HAIKU_EBUSY 380 #define EFAULT HAIKU_EFAULT 381 #define ETIMEDOUT HAIKU_ETIMEDOUT 382 #define EAGAIN HAIKU_EAGAIN 383 #define EWOULDBLOCK HAIKU_EWOULDBLOCK 384 #define EBADF HAIKU_EBADF 385 #define EEXIST HAIKU_EEXIST 386 #define EINVAL HAIKU_EINVAL 387 #define ENAMETOOLONG HAIKU_ENAMETOOLONG 388 #define ENOENT HAIKU_ENOENT 389 #define EPERM HAIKU_EPERM 390 #define ENOTDIR HAIKU_ENOTDIR 391 #define EISDIR HAIKU_EISDIR 392 #define ENOTEMPTY HAIKU_ENOTEMPTY 393 #define ENOSPC HAIKU_ENOSPC 394 #define EROFS HAIKU_EROFS 395 #define EMFILE HAIKU_EMFILE 396 #define EXDEV HAIKU_EXDEV 397 #define ELOOP HAIKU_ELOOP 398 #define ENOEXEC HAIKU_ENOEXEC 399 #define EPIPE HAIKU_EPIPE 400 #define ENOATTR HAIKU_ENOATTR 401 402 #undef errno 403 #define errno (*_haiku_build_errno()) 404 405 #endif // ! BUILDING_HAIKU_ERROR_MAPPER 11 12 /* Error baselines */ 13 #define HAIKU_BUILD_B_GENERAL_ERROR_BASE HAIKU_BUILD_INT_MIN 14 #define HAIKU_BUILD_B_OS_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x1000) 15 #define HAIKU_BUILD_B_APP_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x2000) 16 #define HAIKU_BUILD_B_INTERFACE_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x3000) 17 #define HAIKU_BUILD_B_MEDIA_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x4000) 18 /* - 0x41ff */ 19 #define HAIKU_BUILD_B_TRANSLATION_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x4800) 20 /* - 0x48ff */ 21 #define HAIKU_BUILD_B_MIDI_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x5000) 22 #define HAIKU_BUILD_B_STORAGE_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x6000) 23 #define HAIKU_BUILD_B_POSIX_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x7000) 24 #define HAIKU_BUILD_B_MAIL_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x8000) 25 #define HAIKU_BUILD_B_PRINT_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0x9000) 26 #define HAIKU_BUILD_B_DEVICE_ERROR_BASE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0xa000) 27 28 /* Developer-defined errors start at (B_ERRORS_END+1) */ 29 #define HAIKU_BUILD_B_ERRORS_END (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0xffff) 30 31 /* General Errors */ 32 #define HAIKU_BUILD_B_NO_MEMORY (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 0) 33 #define HAIKU_BUILD_B_IO_ERROR (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 1) 34 #define HAIKU_BUILD_B_PERMISSION_DENIED (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 2) 35 #define HAIKU_BUILD_B_BAD_INDEX (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 3) 36 #define HAIKU_BUILD_B_BAD_TYPE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 4) 37 #define HAIKU_BUILD_B_BAD_VALUE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 5) 38 #define HAIKU_BUILD_B_MISMATCHED_VALUES (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 6) 39 #define HAIKU_BUILD_B_NAME_NOT_FOUND (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 7) 40 #define HAIKU_BUILD_B_NAME_IN_USE (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 8) 41 #define HAIKU_BUILD_B_TIMED_OUT (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 9) 42 #define HAIKU_BUILD_B_INTERRUPTED (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 10) 43 #define HAIKU_BUILD_B_WOULD_BLOCK (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 11) 44 #define HAIKU_BUILD_B_CANCELED (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 12) 45 #define HAIKU_BUILD_B_NO_INIT (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 13) 46 #define HAIKU_BUILD_B_NOT_INITIALIZED (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 13) 47 #define HAIKU_BUILD_B_BUSY (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 14) 48 #define HAIKU_BUILD_B_NOT_ALLOWED (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 15) 49 #define HAIKU_BUILD_B_BAD_DATA (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 16) 50 #define HAIKU_BUILD_B_DONT_DO_THAT (HAIKU_BUILD_B_GENERAL_ERROR_BASE + 17) 51 52 #define HAIKU_BUILD_B_ERROR (-1) 53 #define HAIKU_BUILD_B_OK ((int)0) 54 #define HAIKU_BUILD_B_NO_ERROR ((int)0) 55 56 /* Kernel Kit Errors */ 57 #define HAIKU_BUILD_B_BAD_SEM_ID (HAIKU_BUILD_B_OS_ERROR_BASE + 0) 58 #define HAIKU_BUILD_B_NO_MORE_SEMS (HAIKU_BUILD_B_OS_ERROR_BASE + 1) 59 60 #define HAIKU_BUILD_B_BAD_THREAD_ID (HAIKU_BUILD_B_OS_ERROR_BASE + 0x100) 61 #define HAIKU_BUILD_B_NO_MORE_THREADS (HAIKU_BUILD_B_OS_ERROR_BASE + 0x101) 62 #define HAIKU_BUILD_B_BAD_THREAD_STATE (HAIKU_BUILD_B_OS_ERROR_BASE + 0x102) 63 #define HAIKU_BUILD_B_BAD_TEAM_ID (HAIKU_BUILD_B_OS_ERROR_BASE + 0x103) 64 #define HAIKU_BUILD_B_NO_MORE_TEAMS (HAIKU_BUILD_B_OS_ERROR_BASE + 0x104) 65 66 #define HAIKU_BUILD_B_BAD_PORT_ID (HAIKU_BUILD_B_OS_ERROR_BASE + 0x200) 67 #define HAIKU_BUILD_B_NO_MORE_PORTS (HAIKU_BUILD_B_OS_ERROR_BASE + 0x201) 68 69 #define HAIKU_BUILD_B_BAD_IMAGE_ID (HAIKU_BUILD_B_OS_ERROR_BASE + 0x300) 70 #define HAIKU_BUILD_B_BAD_ADDRESS (HAIKU_BUILD_B_OS_ERROR_BASE + 0x301) 71 #define HAIKU_BUILD_B_NOT_AN_EXECUTABLE (HAIKU_BUILD_B_OS_ERROR_BASE + 0x302) 72 #define HAIKU_BUILD_B_MISSING_LIBRARY (HAIKU_BUILD_B_OS_ERROR_BASE + 0x303) 73 #define HAIKU_BUILD_B_MISSING_SYMBOL (HAIKU_BUILD_B_OS_ERROR_BASE + 0x304) 74 75 #define HAIKU_BUILD_B_DEBUGGER_ALREADY_INSTALLED (HAIKU_BUILD_B_OS_ERROR_BASE + 0x400) 76 77 /* Application Kit Errors */ 78 #define HAIKU_BUILD_B_BAD_REPLY (HAIKU_BUILD_B_APP_ERROR_BASE + 0) 79 #define HAIKU_BUILD_B_DUPLICATE_REPLY (HAIKU_BUILD_B_APP_ERROR_BASE + 1) 80 #define HAIKU_BUILD_B_MESSAGE_TO_SELF (HAIKU_BUILD_B_APP_ERROR_BASE + 2) 81 #define HAIKU_BUILD_B_BAD_HANDLER (HAIKU_BUILD_B_APP_ERROR_BASE + 3) 82 #define HAIKU_BUILD_B_ALREADY_RUNNING (HAIKU_BUILD_B_APP_ERROR_BASE + 4) 83 #define HAIKU_BUILD_B_LAUNCH_FAILED (HAIKU_BUILD_B_APP_ERROR_BASE + 5) 84 #define HAIKU_BUILD_B_AMBIGUOUS_APP_LAUNCH (HAIKU_BUILD_B_APP_ERROR_BASE + 6) 85 #define HAIKU_BUILD_B_UNKNOWN_MIME_TYPE (HAIKU_BUILD_B_APP_ERROR_BASE + 7) 86 #define HAIKU_BUILD_B_BAD_SCRIPT_SYNTAX (HAIKU_BUILD_B_APP_ERROR_BASE + 8) 87 #define HAIKU_BUILD_B_LAUNCH_FAILED_NO_RESOLVE_LINK (HAIKU_BUILD_B_APP_ERROR_BASE + 9) 88 #define HAIKU_BUILD_B_LAUNCH_FAILED_EXECUTABLE (HAIKU_BUILD_B_APP_ERROR_BASE + 10) 89 #define HAIKU_BUILD_B_LAUNCH_FAILED_APP_NOT_FOUND (HAIKU_BUILD_B_APP_ERROR_BASE + 11) 90 #define HAIKU_BUILD_B_LAUNCH_FAILED_APP_IN_TRASH (HAIKU_BUILD_B_APP_ERROR_BASE + 12) 91 #define HAIKU_BUILD_B_LAUNCH_FAILED_NO_PREFERRED_APP (HAIKU_BUILD_B_APP_ERROR_BASE + 13) 92 #define HAIKU_BUILD_B_LAUNCH_FAILED_FILES_APP_NOT_FOUND (HAIKU_BUILD_B_APP_ERROR_BASE + 14) 93 #define HAIKU_BUILD_B_BAD_MIME_SNIFFER_RULE (HAIKU_BUILD_B_APP_ERROR_BASE + 15) 94 #define HAIKU_BUILD_B_NOT_A_MESSAGE (HAIKU_BUILD_B_APP_ERROR_BASE + 16) 95 #define HAIKU_BUILD_B_SHUTDOWN_CANCELLED (HAIKU_BUILD_B_APP_ERROR_BASE + 17) 96 #define HAIKU_BUILD_B_SHUTTING_DOWN (HAIKU_BUILD_B_APP_ERROR_BASE + 18) 97 98 /* Storage Kit/File System Errors */ 99 #define HAIKU_BUILD_B_FILE_ERROR (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 0) 100 #define HAIKU_BUILD_B_FILE_NOT_FOUND (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 1) 101 /* deprecated: use B_ENTRY_NOT_FOUND instead */ 102 #define HAIKU_BUILD_B_FILE_EXISTS (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 2) 103 #define HAIKU_BUILD_B_ENTRY_NOT_FOUND (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 3) 104 #define HAIKU_BUILD_B_NAME_TOO_LONG (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 4) 105 #define HAIKU_BUILD_B_NOT_A_DIRECTORY (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 5) 106 #define HAIKU_BUILD_B_DIRECTORY_NOT_EMPTY (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 6) 107 #define HAIKU_BUILD_B_DEVICE_FULL (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 7) 108 #define HAIKU_BUILD_B_READ_ONLY_DEVICE (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 8) 109 #define HAIKU_BUILD_B_IS_A_DIRECTORY (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 9) 110 #define HAIKU_BUILD_B_NO_MORE_FDS (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 10) 111 #define HAIKU_BUILD_B_CROSS_DEVICE_LINK (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 11) 112 #define HAIKU_BUILD_B_LINK_LIMIT (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 12) 113 #define HAIKU_BUILD_B_BUSTED_PIPE (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 13) 114 #define HAIKU_BUILD_B_UNSUPPORTED (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 14) 115 #define HAIKU_BUILD_B_PARTITION_TOO_SMALL (HAIKU_BUILD_B_STORAGE_ERROR_BASE + 15) 116 117 /* POSIX Errors */ 118 #ifdef HAIKU_BUILD_B_USE_POSITIVE_POSIX_ERRORS 119 # define HAIKU_BUILD_B_TO_POSIX_ERROR(error) (-(error)) 120 # define HAIKU_BUILD_B_FROM_POSIX_ERROR(error) (-(error)) 121 #else 122 # define HAIKU_BUILD_B_TO_POSIX_ERROR(error) (error) 123 # define HAIKU_BUILD_B_FROM_POSIX_ERROR(error) (error) 124 #endif 125 126 #define HAIKU_BUILD_B_POSIX_ENOMEM HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 0) 127 #define HAIKU_BUILD_E2BIG HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 1) 128 #define HAIKU_BUILD_ECHILD HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 2) 129 #define HAIKU_BUILD_EDEADLK HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 3) 130 #define HAIKU_BUILD_EFBIG HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 4) 131 #define HAIKU_BUILD_EMLINK HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 5) 132 #define HAIKU_BUILD_ENFILE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 6) 133 #define HAIKU_BUILD_ENODEV HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 7) 134 #define HAIKU_BUILD_ENOLCK HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 8) 135 #define HAIKU_BUILD_ENOSYS HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 9) 136 #define HAIKU_BUILD_ENOTTY HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 10) 137 #define HAIKU_BUILD_ENXIO HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 11) 138 #define HAIKU_BUILD_ESPIPE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 12) 139 #define HAIKU_BUILD_ESRCH HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 13) 140 #define HAIKU_BUILD_EFPOS HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 14) 141 #define HAIKU_BUILD_ESIGPARM HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 15) 142 #define HAIKU_BUILD_EDOM HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 16) 143 #define HAIKU_BUILD_ERANGE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 17) 144 #define HAIKU_BUILD_EPROTOTYPE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 18) 145 #define HAIKU_BUILD_EPROTONOSUPPORT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 19) 146 #define HAIKU_BUILD_EPFNOSUPPORT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 20) 147 #define HAIKU_BUILD_EAFNOSUPPORT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 21) 148 #define HAIKU_BUILD_EADDRINUSE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 22) 149 #define HAIKU_BUILD_EADDRNOTAVAIL HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 23) 150 #define HAIKU_BUILD_ENETDOWN HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 24) 151 #define HAIKU_BUILD_ENETUNREACH HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 25) 152 #define HAIKU_BUILD_ENETRESET HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 26) 153 #define HAIKU_BUILD_ECONNABORTED HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 27) 154 #define HAIKU_BUILD_ECONNRESET HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 28) 155 #define HAIKU_BUILD_EISCONN HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 29) 156 #define HAIKU_BUILD_ENOTCONN HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 30) 157 #define HAIKU_BUILD_ESHUTDOWN HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 31) 158 #define HAIKU_BUILD_ECONNREFUSED HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 32) 159 #define HAIKU_BUILD_EHOSTUNREACH HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 33) 160 #define HAIKU_BUILD_ENOPROTOOPT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 34) 161 #define HAIKU_BUILD_ENOBUFS HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 35) 162 #define HAIKU_BUILD_EINPROGRESS HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 36) 163 #define HAIKU_BUILD_EALREADY HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 37) 164 #define HAIKU_BUILD_EILSEQ HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 38) 165 #define HAIKU_BUILD_ENOMSG HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 39) 166 #define HAIKU_BUILD_ESTALE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 40) 167 #define HAIKU_BUILD_EOVERFLOW HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 41) 168 #define HAIKU_BUILD_EMSGSIZE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 42) 169 #define HAIKU_BUILD_EOPNOTSUPP HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 43) 170 #define HAIKU_BUILD_ENOTSOCK HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 44) 171 #define HAIKU_BUILD_EHOSTDOWN HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 45) 172 #define HAIKU_BUILD_EBADMSG HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 46) 173 #define HAIKU_BUILD_ECANCELED HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 47) 174 #define HAIKU_BUILD_EDESTADDRREQ HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 48) 175 #define HAIKU_BUILD_EDQUOT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 49) 176 #define HAIKU_BUILD_EIDRM HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 50) 177 #define HAIKU_BUILD_EMULTIHOP HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 51) 178 #define HAIKU_BUILD_ENODATA HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 52) 179 #define HAIKU_BUILD_ENOLINK HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 53) 180 #define HAIKU_BUILD_ENOSR HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 54) 181 #define HAIKU_BUILD_ENOSTR HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 55) 182 #define HAIKU_BUILD_ENOTSUP HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 56) 183 #define HAIKU_BUILD_EPROTO HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 57) 184 #define HAIKU_BUILD_ETIME HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 58) 185 #define HAIKU_BUILD_ETXTBSY HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 59) 186 #define HAIKU_BUILD_ENOATTR HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_POSIX_ERROR_BASE + 60) 187 188 /* B_NO_MEMORY (0x80000000) can't be negated, so it needs special handling */ 189 #ifdef HAIKU_BUILD_B_USE_POSITIVE_POSIX_ERRORS 190 # define HAIKU_BUILD_ENOMEM HAIKU_BUILD_B_POSIX_ENOMEM 191 #else 192 # define HAIKU_BUILD_ENOMEM HAIKU_BUILD_B_NO_MEMORY 193 #endif 194 195 /* POSIX errors that can be mapped to BeOS error codes */ 196 #define HAIKU_BUILD_EACCES HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_PERMISSION_DENIED) 197 #define HAIKU_BUILD_EINTR HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_INTERRUPTED) 198 #define HAIKU_BUILD_EIO HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_IO_ERROR) 199 #define HAIKU_BUILD_EBUSY HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_BUSY) 200 #define HAIKU_BUILD_EFAULT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_BAD_ADDRESS) 201 #define HAIKU_BUILD_ETIMEDOUT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_TIMED_OUT) 202 #define HAIKU_BUILD_EAGAIN HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_WOULD_BLOCK) /* SysV compatibility */ 203 #define HAIKU_BUILD_EWOULDBLOCK HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_WOULD_BLOCK) /* BSD compatibility */ 204 #define HAIKU_BUILD_EBADF HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_FILE_ERROR) 205 #define HAIKU_BUILD_EEXIST HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_FILE_EXISTS) 206 #define HAIKU_BUILD_EINVAL HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_BAD_VALUE) 207 #define HAIKU_BUILD_ENAMETOOLONG HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_NAME_TOO_LONG) 208 #define HAIKU_BUILD_ENOENT HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_ENTRY_NOT_FOUND) 209 #define HAIKU_BUILD_EPERM HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_NOT_ALLOWED) 210 #define HAIKU_BUILD_ENOTDIR HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_NOT_A_DIRECTORY) 211 #define HAIKU_BUILD_EISDIR HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_IS_A_DIRECTORY) 212 #define HAIKU_BUILD_ENOTEMPTY HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_DIRECTORY_NOT_EMPTY) 213 #define HAIKU_BUILD_ENOSPC HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_DEVICE_FULL) 214 #define HAIKU_BUILD_EROFS HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_READ_ONLY_DEVICE) 215 #define HAIKU_BUILD_EMFILE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_NO_MORE_FDS) 216 #define HAIKU_BUILD_EXDEV HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_CROSS_DEVICE_LINK) 217 #define HAIKU_BUILD_ELOOP HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_LINK_LIMIT) 218 #define HAIKU_BUILD_ENOEXEC HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_NOT_AN_EXECUTABLE) 219 #define HAIKU_BUILD_EPIPE HAIKU_BUILD_B_TO_POSIX_ERROR(HAIKU_BUILD_B_BUSTED_PIPE) 220 221 /* new error codes that can be mapped to POSIX errors */ 222 #define HAIKU_BUILD_B_BUFFER_OVERFLOW HAIKU_BUILD_B_FROM_POSIX_ERROR(HAIKU_BUILD_EOVERFLOW) 223 #define HAIKU_BUILD_B_TOO_MANY_ARGS HAIKU_BUILD_B_FROM_POSIX_ERROR(HAIKU_BUILD_E2BIG) 224 #define HAIKU_BUILD_B_FILE_TOO_LARGE HAIKU_BUILD_B_FROM_POSIX_ERROR(HAIKU_BUILD_EFBIG) 225 #define HAIKU_BUILD_B_RESULT_NOT_REPRESENTABLE HAIKU_BUILD_B_FROM_POSIX_ERROR(HAIKU_BUILD_ERANGE) 226 #define HAIKU_BUILD_B_DEVICE_NOT_FOUND HAIKU_BUILD_B_FROM_POSIX_ERROR(HAIKU_BUILD_ENODEV) 227 #define HAIKU_BUILD_B_NOT_SUPPORTED HAIKU_BUILD_B_FROM_POSIX_ERROR(HAIKU_BUILD_EOPNOTSUPP) 228 229 /* Media Kit Errors */ 230 #define HAIKU_BUILD_B_STREAM_NOT_FOUND (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 0) 231 #define HAIKU_BUILD_B_SERVER_NOT_FOUND (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 1) 232 #define HAIKU_BUILD_B_RESOURCE_NOT_FOUND (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 2) 233 #define HAIKU_BUILD_B_RESOURCE_UNAVAILABLE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 3) 234 #define HAIKU_BUILD_B_BAD_SUBSCRIBER (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 4) 235 #define HAIKU_BUILD_B_SUBSCRIBER_NOT_ENTERED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 5) 236 #define HAIKU_BUILD_B_BUFFER_NOT_AVAILABLE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 6) 237 #define HAIKU_BUILD_B_LAST_BUFFER_ERROR (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 7) 238 239 #define HAIKU_BUILD_B_MEDIA_SYSTEM_FAILURE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 100) 240 #define HAIKU_BUILD_B_MEDIA_BAD_NODE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 101) 241 #define HAIKU_BUILD_B_MEDIA_NODE_BUSY (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 102) 242 #define HAIKU_BUILD_B_MEDIA_BAD_FORMAT (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 103) 243 #define HAIKU_BUILD_B_MEDIA_BAD_BUFFER (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 104) 244 #define HAIKU_BUILD_B_MEDIA_TOO_MANY_NODES (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 105) 245 #define HAIKU_BUILD_B_MEDIA_TOO_MANY_BUFFERS (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 106) 246 #define HAIKU_BUILD_B_MEDIA_NODE_ALREADY_EXISTS (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 107) 247 #define HAIKU_BUILD_B_MEDIA_BUFFER_ALREADY_EXISTS (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 108) 248 #define HAIKU_BUILD_B_MEDIA_CANNOT_SEEK (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 109) 249 #define HAIKU_BUILD_B_MEDIA_CANNOT_CHANGE_RUN_MODE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 110) 250 #define HAIKU_BUILD_B_MEDIA_APP_ALREADY_REGISTERED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 111) 251 #define HAIKU_BUILD_B_MEDIA_APP_NOT_REGISTERED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 112) 252 #define HAIKU_BUILD_B_MEDIA_CANNOT_RECLAIM_BUFFERS (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 113) 253 #define HAIKU_BUILD_B_MEDIA_BUFFERS_NOT_RECLAIMED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 114) 254 #define HAIKU_BUILD_B_MEDIA_TIME_SOURCE_STOPPED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 115) 255 #define HAIKU_BUILD_B_MEDIA_TIME_SOURCE_BUSY (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 116) 256 #define HAIKU_BUILD_B_MEDIA_BAD_SOURCE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 117) 257 #define HAIKU_BUILD_B_MEDIA_BAD_DESTINATION (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 118) 258 #define HAIKU_BUILD_B_MEDIA_ALREADY_CONNECTED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 119) 259 #define HAIKU_BUILD_B_MEDIA_NOT_CONNECTED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 120) 260 #define HAIKU_BUILD_B_MEDIA_BAD_CLIP_FORMAT (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 121) 261 #define HAIKU_BUILD_B_MEDIA_ADDON_FAILED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 122) 262 #define HAIKU_BUILD_B_MEDIA_ADDON_DISABLED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 123) 263 #define HAIKU_BUILD_B_MEDIA_CHANGE_IN_PROGRESS (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 124) 264 #define HAIKU_BUILD_B_MEDIA_STALE_CHANGE_COUNT (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 125) 265 #define HAIKU_BUILD_B_MEDIA_ADDON_RESTRICTED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 126) 266 #define HAIKU_BUILD_B_MEDIA_NO_HANDLER (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 127) 267 #define HAIKU_BUILD_B_MEDIA_DUPLICATE_FORMAT (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 128) 268 #define HAIKU_BUILD_B_MEDIA_REALTIME_DISABLED (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 129) 269 #define HAIKU_BUILD_B_MEDIA_REALTIME_UNAVAILABLE (HAIKU_BUILD_B_MEDIA_ERROR_BASE + 130) 270 271 /* Mail Kit Errors */ 272 #define HAIKU_BUILD_B_MAIL_NO_DAEMON (HAIKU_BUILD_B_MAIL_ERROR_BASE + 0) 273 #define HAIKU_BUILD_B_MAIL_UNKNOWN_USER (HAIKU_BUILD_B_MAIL_ERROR_BASE + 1) 274 #define HAIKU_BUILD_B_MAIL_WRONG_PASSWORD (HAIKU_BUILD_B_MAIL_ERROR_BASE + 2) 275 #define HAIKU_BUILD_B_MAIL_UNKNOWN_HOST (HAIKU_BUILD_B_MAIL_ERROR_BASE + 3) 276 #define HAIKU_BUILD_B_MAIL_ACCESS_ERROR (HAIKU_BUILD_B_MAIL_ERROR_BASE + 4) 277 #define HAIKU_BUILD_B_MAIL_UNKNOWN_FIELD (HAIKU_BUILD_B_MAIL_ERROR_BASE + 5) 278 #define HAIKU_BUILD_B_MAIL_NO_RECIPIENT (HAIKU_BUILD_B_MAIL_ERROR_BASE + 6) 279 #define HAIKU_BUILD_B_MAIL_INVALID_MAIL (HAIKU_BUILD_B_MAIL_ERROR_BASE + 7) 280 281 /* Printing Errors */ 282 #define HAIKU_BUILD_B_NO_PRINT_SERVER (HAIKU_BUILD_B_PRINT_ERROR_BASE + 0) 283 284 /* Device Kit Errors */ 285 #define HAIKU_BUILD_B_DEV_INVALID_IOCTL (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 0) 286 #define HAIKU_BUILD_B_DEV_NO_MEMORY (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 1) 287 #define HAIKU_BUILD_B_DEV_BAD_DRIVE_NUM (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 2) 288 #define HAIKU_BUILD_B_DEV_NO_MEDIA (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 3) 289 #define HAIKU_BUILD_B_DEV_UNREADABLE (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 4) 290 #define HAIKU_BUILD_B_DEV_FORMAT_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 5) 291 #define HAIKU_BUILD_B_DEV_TIMEOUT (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 6) 292 #define HAIKU_BUILD_B_DEV_RECALIBRATE_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 7) 293 #define HAIKU_BUILD_B_DEV_SEEK_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 8) 294 #define HAIKU_BUILD_B_DEV_ID_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 9) 295 #define HAIKU_BUILD_B_DEV_READ_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 10) 296 #define HAIKU_BUILD_B_DEV_WRITE_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 11) 297 #define HAIKU_BUILD_B_DEV_NOT_READY (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 12) 298 #define HAIKU_BUILD_B_DEV_MEDIA_CHANGED (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 13) 299 #define HAIKU_BUILD_B_DEV_MEDIA_CHANGE_REQUESTED (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 14) 300 #define HAIKU_BUILD_B_DEV_RESOURCE_CONFLICT (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 15) 301 #define HAIKU_BUILD_B_DEV_CONFIGURATION_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 16) 302 #define HAIKU_BUILD_B_DEV_DISABLED_BY_USER (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 17) 303 #define HAIKU_BUILD_B_DEV_DOOR_OPEN (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 18) 304 305 #define HAIKU_BUILD_B_DEV_INVALID_PIPE (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 19) 306 #define HAIKU_BUILD_B_DEV_CRC_ERROR (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 20) 307 #define HAIKU_BUILD_B_DEV_STALLED (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 21) 308 #define HAIKU_BUILD_B_DEV_BAD_PID (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 22) 309 #define HAIKU_BUILD_B_DEV_UNEXPECTED_PID (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 23) 310 #define HAIKU_BUILD_B_DEV_DATA_OVERRUN (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 24) 311 #define HAIKU_BUILD_B_DEV_DATA_UNDERRUN (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 25) 312 #define HAIKU_BUILD_B_DEV_FIFO_OVERRUN (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 26) 313 #define HAIKU_BUILD_B_DEV_FIFO_UNDERRUN (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 27) 314 #define HAIKU_BUILD_B_DEV_PENDING (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 28) 315 #define HAIKU_BUILD_B_DEV_MULTIPLE_ERRORS (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 29) 316 #define HAIKU_BUILD_B_DEV_TOO_LATE (HAIKU_BUILD_B_DEVICE_ERROR_BASE + 30) 317 318 /* Translation Kit Errors */ 319 #define HAIKU_BUILD_B_TRANSLATION_BASE_ERROR (HAIKU_BUILD_B_TRANSLATION_ERROR_BASE + 0) 320 #define HAIKU_BUILD_B_NO_TRANSLATOR (HAIKU_BUILD_B_TRANSLATION_ERROR_BASE + 1) 321 #define HAIKU_BUILD_B_ILLEGAL_DATA (HAIKU_BUILD_B_TRANSLATION_ERROR_BASE + 2) 322 323 324 #define HAIKU_BUILD_B_TO_POSITIVE_ERROR(error) _haiku_build_to_positive_error(error) 325 #define HAIKU_BUILD_B_TO_NEGATIVE_ERROR(error) _haiku_build_to_negative_error(error) 326 406 327 407 328 #ifdef __cplusplus 408 329 extern "C" { 409 330 #endif 410 331 411 extern int *_haiku_build_errno();412 extern int _haiku_to_host_error(int error);332 int _haiku_build_to_positive_error(int error); 333 int _haiku_build_to_negative_error(int error); 413 334 414 335 #ifdef __cplusplus 415 336 } 416 337 #endif 417 338 418 419 /*---- new error codes that can be mapped to POSIX errors ----*/ 420 #define B_BUFFER_OVERFLOW HAIKU_EOVERFLOW 421 #define B_TOO_MANY_ARGS HAIKU_E2BIG 422 #define B_FILE_TOO_LARGE HAIKU_EFBIG 423 #define B_RESULT_NOT_REPRESENTABLE HAIKU_ERANGE 424 #define B_DEVICE_NOT_FOUND HAIKU_ENODEV 425 #define B_NOT_SUPPORTED HAIKU_EOPNOTSUPP 426 427 /*-------------------------------------------------------------*/ 428 /*----- Media Kit Errors --------------------------------------*/ 429 enum { 430 B_STREAM_NOT_FOUND = B_MEDIA_ERROR_BASE, 431 B_SERVER_NOT_FOUND, 432 B_RESOURCE_NOT_FOUND, 433 B_RESOURCE_UNAVAILABLE, 434 B_BAD_SUBSCRIBER, 435 B_SUBSCRIBER_NOT_ENTERED, 436 B_BUFFER_NOT_AVAILABLE, 437 B_LAST_BUFFER_ERROR 438 }; 439 440 /*-------------------------------------------------------------*/ 441 /*----- Mail Kit Errors ---------------------------------------*/ 442 enum 443 { 444 B_MAIL_NO_DAEMON = B_MAIL_ERROR_BASE, 445 B_MAIL_UNKNOWN_USER, 446 B_MAIL_WRONG_PASSWORD, 447 B_MAIL_UNKNOWN_HOST, 448 B_MAIL_ACCESS_ERROR, 449 B_MAIL_UNKNOWN_FIELD, 450 B_MAIL_NO_RECIPIENT, 451 B_MAIL_INVALID_MAIL 452 }; 453 454 /*-------------------------------------------------------------*/ 455 /*----- Printing Errors --------------------------------------*/ 456 enum 457 { 458 B_NO_PRINT_SERVER = B_PRINT_ERROR_BASE 459 }; 460 461 /*-------------------------------------------------------------*/ 462 /*----- Device Kit Errors -------------------------------------*/ 463 enum 464 { 465 B_DEV_INVALID_IOCTL = B_DEVICE_ERROR_BASE, 466 B_DEV_NO_MEMORY, 467 B_DEV_BAD_DRIVE_NUM, 468 B_DEV_NO_MEDIA, 469 B_DEV_UNREADABLE, 470 B_DEV_FORMAT_ERROR, 471 B_DEV_TIMEOUT, 472 B_DEV_RECALIBRATE_ERROR, 473 B_DEV_SEEK_ERROR, 474 B_DEV_ID_ERROR, 475 B_DEV_READ_ERROR, 476 B_DEV_WRITE_ERROR, 477 B_DEV_NOT_READY, 478 B_DEV_MEDIA_CHANGED, 479 B_DEV_MEDIA_CHANGE_REQUESTED, 480 B_DEV_RESOURCE_CONFLICT, 481 B_DEV_CONFIGURATION_ERROR, 482 B_DEV_DISABLED_BY_USER, 483 B_DEV_DOOR_OPEN, 484 485 B_DEV_INVALID_PIPE, 486 B_DEV_CRC_ERROR, 487 B_DEV_STALLED, 488 B_DEV_BAD_PID, 489 B_DEV_UNEXPECTED_PID, 490 B_DEV_DATA_OVERRUN, 491 B_DEV_DATA_UNDERRUN, 492 B_DEV_FIFO_OVERRUN, 493 B_DEV_FIFO_UNDERRUN, 494 B_DEV_PENDING, 495 B_DEV_MULTIPLE_ERRORS, 496 B_DEV_TOO_LATE, 497 }; 498 499 #endif /* _ERRORS_H */ 339 #endif /* _HAIKU_BUILD_ERRORS_H */ -
headers/build/os/support/SupportDefs.h
diff --git a/headers/build/os/support/SupportDefs.h b/headers/build/os/support/SupportDefs.h index f400fd3..e0f898d 100644
a b 1 /* 2 * Copyright 2004-2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Author: 6 * Erik Jaesler (erik@cgsoftware.com) 7 */ 8 #ifndef _HAIKU_BUILD_SUPPORT_DEFS_H 9 #define _HAIKU_BUILD_SUPPORT_DEFS_H 10 11 1 12 #include <config_build/types.h> 2 #include <../os/support/SupportDefs.h> 13 14 #include <BeBuild.h> 15 #include <Errors.h> 16 17 #include <inttypes.h> 18 #include <sys/types.h> 19 20 21 /* fixed-size integer types */ 22 typedef __haiku_build_haiku_int8 haiku_build_int8; 23 typedef __haiku_build_haiku_uint8 haiku_build_uint8; 24 typedef __haiku_build_haiku_int16 haiku_build_int16; 25 typedef __haiku_build_haiku_uint16 haiku_build_uint16; 26 typedef __haiku_build_haiku_int32 haiku_build_int32; 27 typedef __haiku_build_haiku_uint32 haiku_build_uint32; 28 typedef __haiku_build_haiku_int64 haiku_build_int64; 29 typedef __haiku_build_haiku_uint64 haiku_build_uint64; 30 31 /* shorthand types */ 32 typedef volatile haiku_build_int8 haiku_build_vint8; 33 typedef volatile haiku_build_uint8 haiku_build_vuint8; 34 typedef volatile haiku_build_int16 haiku_build_vint16; 35 typedef volatile haiku_build_uint16 haiku_build_vuint16; 36 typedef volatile haiku_build_int32 haiku_build_vint32; 37 typedef volatile haiku_build_uint32 haiku_build_vuint32; 38 typedef volatile haiku_build_int64 haiku_build_vint64; 39 typedef volatile haiku_build_uint64 haiku_build_vuint64; 40 41 typedef volatile long haiku_build_vlong; 42 typedef volatile int haiku_build_vint; 43 typedef volatile short haiku_build_vshort; 44 typedef volatile char haiku_build_vchar; 45 46 typedef volatile unsigned long haiku_build_vulong; 47 typedef volatile unsigned int haiku_build_vuint; 48 typedef volatile unsigned short haiku_build_vushort; 49 typedef volatile unsigned char haiku_build_vuchar; 50 51 typedef unsigned char haiku_build_uchar; 52 typedef unsigned short haiku_build_unichar; 53 54 /* descriptive types */ 55 typedef haiku_build_int32 haiku_build_status_t; 56 typedef haiku_build_int64 haiku_build_bigtime_t; 57 typedef haiku_build_int64 haiku_build_nanotime_t; 58 typedef haiku_build_uint32 haiku_build_type_code; 59 typedef haiku_build_uint32 haiku_build_perform_code; 60 61 typedef __haiku_build_haiku_phys_addr_t haiku_build_phys_addr_t; 62 typedef haiku_build_phys_addr_t haiku_build_phys_size_t; 63 64 typedef __haiku_build_haiku_generic_addr_t haiku_build_generic_addr_t; 65 typedef haiku_build_generic_addr_t haiku_build_generic_size_t; 66 67 68 /* printf()/scanf() format strings for [u]int* types */ 69 #define HAIKU_BUILD_B_PRId8 "d" 70 #define HAIKU_BUILD_B_PRIi8 "i" 71 #define HAIKU_BUILD_B_PRId16 "d" 72 #define HAIKU_BUILD_B_PRIi16 "i" 73 #define HAIKU_BUILD_B_PRId32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "d" 74 #define HAIKU_BUILD_B_PRIi32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "i" 75 #define HAIKU_BUILD_B_PRId64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "d" 76 #define HAIKU_BUILD_B_PRIi64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "i" 77 #define HAIKU_BUILD_B_PRIu8 "u" 78 #define HAIKU_BUILD_B_PRIo8 "o" 79 #define HAIKU_BUILD_B_PRIx8 "x" 80 #define HAIKU_BUILD_B_PRIX8 "X" 81 #define HAIKU_BUILD_B_PRIu16 "u" 82 #define HAIKU_BUILD_B_PRIo16 "o" 83 #define HAIKU_BUILD_B_PRIx16 "x" 84 #define HAIKU_BUILD_B_PRIX16 "X" 85 #define HAIKU_BUILD_B_PRIu32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "u" 86 #define HAIKU_BUILD_B_PRIo32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "o" 87 #define HAIKU_BUILD_B_PRIx32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "x" 88 #define HAIKU_BUILD_B_PRIX32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "X" 89 #define HAIKU_BUILD_B_PRIu64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "u" 90 #define HAIKU_BUILD_B_PRIo64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "o" 91 #define HAIKU_BUILD_B_PRIx64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "x" 92 #define HAIKU_BUILD_B_PRIX64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "X" 93 94 #define HAIKU_BUILD_B_SCNd8 "hhd" 95 #define HAIKU_BUILD_B_SCNi8 "hhi" 96 #define HAIKU_BUILD_B_SCNd16 "hd" 97 #define HAIKU_BUILD_B_SCNi16 "hi" 98 #define HAIKU_BUILD_B_SCNd32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "d" 99 #define HAIKU_BUILD_B_SCNi32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "i" 100 #define HAIKU_BUILD_B_SCNd64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "d" 101 #define HAIKU_BUILD_B_SCNi64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "i" 102 #define HAIKU_BUILD_B_SCNu8 "hhu" 103 #define HAIKU_BUILD_B_SCNo8 "hho" 104 #define HAIKU_BUILD_B_SCNx8 "hhx" 105 #define HAIKU_BUILD_B_SCNu16 "hu" 106 #define HAIKU_BUILD_B_SCNo16 "ho" 107 #define HAIKU_BUILD_B_SCNx16 "hx" 108 #define HAIKU_BUILD_B_SCNu32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "u" 109 #define HAIKU_BUILD_B_SCNo32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "o" 110 #define HAIKU_BUILD_B_SCNx32 __HAIKU_BUILD_HAIKU_PRI_PREFIX_32 "x" 111 #define HAIKU_BUILD_B_SCNu64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "u" 112 #define HAIKU_BUILD_B_SCNo64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "o" 113 #define HAIKU_BUILD_B_SCNx64 __HAIKU_BUILD_HAIKU_PRI_PREFIX_64 "x" 114 115 /* printf() format strings for some standard types */ 116 /* size_t */ 117 #define HAIKU_BUILD_B_PRIuSIZE __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "u" 118 #define HAIKU_BUILD_B_PRIoSIZE __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "o" 119 #define HAIKU_BUILD_B_PRIxSIZE __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "x" 120 #define HAIKU_BUILD_B_PRIXSIZE __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "X" 121 /* ssize_t */ 122 #define HAIKU_BUILD_B_PRIdSSIZE __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "d" 123 #define HAIKU_BUILD_B_PRIiSSIZE __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "i" 124 /* addr_t */ 125 #define HAIKU_BUILD_B_PRIuADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "u" 126 #define HAIKU_BUILD_B_PRIoADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "o" 127 #define HAIKU_BUILD_B_PRIxADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "x" 128 #define HAIKU_BUILD_B_PRIXADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR "X" 129 /* phys_addr_t */ 130 #define HAIKU_BUILD_B_PRIuPHYSADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR "u" 131 #define HAIKU_BUILD_B_PRIoPHYSADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR "o" 132 #define HAIKU_BUILD_B_PRIxPHYSADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR "x" 133 #define HAIKU_BUILD_B_PRIXPHYSADDR __HAIKU_BUILD_HAIKU_PRI_PREFIX_PHYS_ADDR "X" 134 /* generic_addr_t */ 135 #define HAIKU_BUILD_B_PRIuGENADDR \ 136 __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR "u" 137 #define HAIKU_BUILD_B_PRIoGENADDR \ 138 __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR "o" 139 #define HAIKU_BUILD_B_PRIxGENADDR \ 140 __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR "x" 141 #define HAIKU_BUILD_B_PRIXGENADDR \ 142 __HAIKU_BUILD_HAIKU_PRI_PREFIX_GENERIC_ADDR "X" 143 /* off_t */ 144 #define HAIKU_BUILD_B_PRIdOFF HAIKU_BUILD_B_PRId64 145 #define HAIKU_BUILD_B_PRIiOFF HAIKU_BUILD_B_PRIi64 146 /* dev_t */ 147 #define HAIKU_BUILD_B_PRIdDEV HAIKU_BUILD_B_PRId32 148 #define HAIKU_BUILD_B_PRIiDEV HAIKU_BUILD_B_PRIi32 149 /* ino_t */ 150 #define HAIKU_BUILD_B_PRIdINO HAIKU_BUILD_B_PRId64 151 #define HAIKU_BUILD_B_PRIiINO HAIKU_BUILD_B_PRIi64 152 /* time_t */ 153 #define HAIKU_BUILD_B_PRIdTIME HAIKU_BUILD_B_PRId32 154 #define HAIKU_BUILD_B_PRIiTIME HAIKU_BUILD_B_PRIi32 155 156 157 /* Empty string ("") */ 158 #ifdef __cplusplus 159 extern const char *HAIKU_BUILD_B_EMPTY_STRING; 160 #endif 161 162 163 /* min and max comparisons */ 164 #ifndef __cplusplus 165 # ifndef haiku_build_min 166 # define haiku_build_min(a,b) ((a)>(b)?(b):(a)) 167 # endif 168 # ifndef haiku_build_max 169 # define haiku_build_max(a,b) ((a)>(b)?(a):(b)) 170 # endif 171 #endif 172 173 /* min() and max() are functions in C++ */ 174 #define haiku_build_min_c(a,b) ((a)>(b)?(b):(a)) 175 #define haiku_build_max_c(a,b) ((a)>(b)?(a):(b)) 176 177 178 /* Grandfathering */ 179 #ifndef __cplusplus 180 # include <stdbool.h> 181 #endif 182 183 /* 184 #ifndef HAIKU_BUILD_NULL 185 # define HAIKU_BUILD_NULL (0) 186 #endif 187 */ 188 189 190 #ifdef __cplusplus 191 extern "C" { 192 #endif 193 194 /* Atomic functions; previous value is returned */ 195 extern haiku_build_int32 haiku_build_atomic_set(haiku_build_vint32 *value, 196 haiku_build_int32 newValue); 197 extern haiku_build_int32 haiku_build_atomic_test_and_set( 198 haiku_build_vint32 *value, 199 haiku_build_int32 newValue, 200 haiku_build_int32 testAgainst); 201 extern haiku_build_int32 haiku_build_atomic_add(haiku_build_vint32 *value, 202 haiku_build_int32 addValue); 203 extern haiku_build_int32 haiku_build_atomic_and(haiku_build_vint32 *value, 204 haiku_build_int32 andValue); 205 extern haiku_build_int32 haiku_build_atomic_or(haiku_build_vint32 *value, 206 haiku_build_int32 orValue); 207 extern haiku_build_int32 haiku_build_atomic_get(haiku_build_vint32 *value); 208 209 extern haiku_build_int64 haiku_build_atomic_set64(haiku_build_vint64 *value, 210 haiku_build_int64 newValue); 211 extern haiku_build_int64 haiku_build_atomic_test_and_set64( 212 haiku_build_vint64 *value, 213 haiku_build_int64 newValue, 214 haiku_build_int64 testAgainst); 215 extern haiku_build_int64 haiku_build_atomic_add64(haiku_build_vint64 *value, 216 haiku_build_int64 addValue); 217 extern haiku_build_int64 haiku_build_atomic_and64(haiku_build_vint64 *value, 218 haiku_build_int64 andValue); 219 extern haiku_build_int64 haiku_build_atomic_or64(haiku_build_vint64 *value, 220 haiku_build_int64 orValue); 221 extern haiku_build_int64 haiku_build_atomic_get64(haiku_build_vint64 *value); 222 223 /* Other stuff */ 224 extern void* haiku_build_get_stack_frame(void); 225 226 #ifdef __cplusplus 227 } 228 #endif 229 230 /* Obsolete or discouraged API */ 231 232 /* use 'true' and 'false' */ 233 #ifndef FALSE 234 # define FALSE 0 235 #endif 236 #ifndef TRUE 237 # define TRUE 1 238 #endif 239 240 241 /* Use the built-in atomic functions, if requested and available. */ 242 243 #if defined(HAIKU_BUILD_B_USE_BUILTIN_ATOMIC_FUNCTIONS) && __GNUC__ >= 4 244 245 #define haiku_build_atomic_test_and_set(valuePointer, newValue, testAgainst) \ 246 __sync_val_compare_and_swap(valuePointer, testAgainst, newValue) 247 #define haiku_build_atomic_add(valuePointer, addValue) \ 248 __sync_fetch_and_add(valuePointer, addValue) 249 #define haiku_build_atomic_and(valuePointer, andValue) \ 250 __sync_fetch_and_and(valuePointer, andValue) 251 #define haiku_build_atomic_or(valuePointer, orValue) \ 252 __sync_fetch_and_or(valuePointer, orValue) 253 #define haiku_build_atomic_get(valuePointer) \ 254 __sync_fetch_and_or(valuePointer, 0) 255 // No equivalent to atomic_get(). We simulate it via atomic or. On most 256 // (all?) 32+ bit architectures aligned 32 bit reads will be atomic anyway, 257 // though. 258 259 // Note: No equivalent for atomic_set(). It could be simulated by a 260 // get + atomic test and set loop, but calling the atomic_set() implementation 261 // might be faster. 262 263 #endif // HAIKU_BUILD_B_USE_BUILTIN_ATOMIC_FUNCTIONS && __GNUC__ >= 4 264 265 266 #endif /* _HAIKU_BUILD_SUPPORT_DEFS_H */ -
new file headers/build/posix/alloca.h
diff --git a/headers/build/posix/alloca.h b/headers/build/posix/alloca.h new file mode 100644 index 0000000..482e4e9
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_ALLOCA_H 6 #define _HAIKU_BUILD_ALLOCA_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <alloca.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_ALLOCA_H */ -
new file headers/build/posix/assert.h
diff --git a/headers/build/posix/arpa/inet.h b/headers/build/posix/arpa/inet.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/arpa/nameser.h b/headers/build/posix/arpa/nameser.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/arpa/nameser_compat.h b/headers/build/posix/arpa/nameser_compat.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/assert.h b/headers/build/posix/assert.h new file mode 100644 index 0000000..4e7cf94
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_ASSERT_H 6 #define _HAIKU_BUILD_ASSERT_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <assert.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_ASSERT_H */ -
new file headers/build/posix/ctype.h
diff --git a/headers/build/posix/ctype.h b/headers/build/posix/ctype.h new file mode 100644 index 0000000..2153df7
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_CTYPE_H 6 #define _HAIKU_BUILD_CTYPE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <ctype.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_CTYPE_H */ -
new file headers/build/posix/dirent.h
diff --git a/headers/build/posix/dirent.h b/headers/build/posix/dirent.h new file mode 100644 index 0000000..a34a90f
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_DIRTYPE_H 6 #define _HAIKU_BUILD_DIRTYPE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <dirent.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_DIRTYPE_H */ -
new file headers/build/posix/dlfcn.h
diff --git a/headers/build/posix/dlfcn.h b/headers/build/posix/dlfcn.h new file mode 100644 index 0000000..b3fad93
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_DLFCN_H 6 #define _HAIKU_BUILD_DLFCN_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <dlfcn.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_DLFCN_H */ -
new file headers/build/posix/endian.h
diff --git a/headers/build/posix/endian.h b/headers/build/posix/endian.h new file mode 100644 index 0000000..601b693
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_ENDIAN_H 6 #define _HAIKU_BUILD_ENDIAN_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <endian.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_ENDIAN_H */ -
new file headers/build/posix/errno.h
diff --git a/headers/build/posix/errno.h b/headers/build/posix/errno.h new file mode 100644 index 0000000..ce58ea7
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_ERRNO_H 6 #define _HAIKU_BUILD_ERRNO_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <errno.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_ERRNO_H */ -
new file headers/build/posix/fcntl.h
diff --git a/headers/build/posix/fcntl.h b/headers/build/posix/fcntl.h new file mode 100644 index 0000000..8925ebe
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_FCNTL_H 6 #define _HAIKU_BUILD_FCNTL_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <fcntl.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_FCNTL_H */ -
new file headers/build/posix/fenv.h
diff --git a/headers/build/posix/fenv.h b/headers/build/posix/fenv.h new file mode 100644 index 0000000..d1c8655
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_FENV_H 6 #define _HAIKU_BUILD_FENV_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <fenv.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_FENV_H */ -
new file headers/build/posix/fnmatch.h
diff --git a/headers/build/posix/fnmatch.h b/headers/build/posix/fnmatch.h new file mode 100644 index 0000000..f6d8cc5
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_FNMATCH_H 6 #define _HAIKU_BUILD_FNMATCH_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <fnmatch.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_FNMATCH_H */ -
new file headers/build/posix/getopt.h
diff --git a/headers/build/posix/getopt.h b/headers/build/posix/getopt.h new file mode 100644 index 0000000..5cbc123
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_GETOPT_H 6 #define _HAIKU_BUILD_GETOPT_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <getopt.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_GETOPT_H */ -
new file headers/build/posix/glob.h
diff --git a/headers/build/posix/glob.h b/headers/build/posix/glob.h new file mode 100644 index 0000000..86938dc
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_GLOB_H 6 #define _HAIKU_BUILD_GLOB_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <glob.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_GLOB_H */ -
new file headers/build/posix/grp.h
diff --git a/headers/build/posix/grp.h b/headers/build/posix/grp.h new file mode 100644 index 0000000..c28cf6a
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_GRP_H 6 #define _HAIKU_BUILD_GRP_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <grp.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_GRP_H */ -
new file headers/build/posix/inttypes.h
diff --git a/headers/build/posix/inttypes.h b/headers/build/posix/inttypes.h new file mode 100644 index 0000000..d4ad8f8
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_INTTYPES_H 6 #define _HAIKU_BUILD_INTTYPES_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <inttypes.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_INTTYPES_H */ -
new file headers/build/posix/iovec.h
diff --git a/headers/build/posix/iovec.h b/headers/build/posix/iovec.h new file mode 100644 index 0000000..0c360d7
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_IOVEC_H 6 #define _HAIKU_BUILD_IOVEC_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <iovec.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_IOVEC_H */ -
new file headers/build/posix/langinfo.h
diff --git a/headers/build/posix/langinfo.h b/headers/build/posix/langinfo.h new file mode 100644 index 0000000..c9c61f9
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_LANGINFO_H 6 #define _HAIKU_BUILD_LANGINFO_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <langinfo.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_LANGINFO_H */ -
new file headers/build/posix/libgen.h
diff --git a/headers/build/posix/libgen.h b/headers/build/posix/libgen.h new file mode 100644 index 0000000..79b89d7
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_LIBGEN_H 6 #define _HAIKU_BUILD_LIBGEN_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <libgen.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_LIBGEN_H */ -
new file headers/build/posix/libio.h
diff --git a/headers/build/posix/libio.h b/headers/build/posix/libio.h new file mode 100644 index 0000000..00122ec
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_LIBIO_H 6 #define _HAIKU_BUILD_LIBIO_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <libio.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_LIBIO_H */ -
new file headers/build/posix/limits.h
diff --git a/headers/build/posix/limits.h b/headers/build/posix/limits.h new file mode 100644 index 0000000..6cee232
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_LIMITS_H 6 #define _HAIKU_BUILD_LIMITS_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <limits.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_LIMITS_H */ -
new file headers/build/posix/locale.h
diff --git a/headers/build/posix/locale.h b/headers/build/posix/locale.h new file mode 100644 index 0000000..7f5467b
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_LOCALE_H 6 #define _HAIKU_BUILD_LOCALE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <locale.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_LOCALE_H */ -
new file headers/build/posix/malloc.h
diff --git a/headers/build/posix/malloc.h b/headers/build/posix/malloc.h new file mode 100644 index 0000000..2a4f91f
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_MALLOC_H 6 #define _HAIKU_BUILD_MALLOC_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <malloc.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_MALLOC_H */ -
new file headers/build/posix/math.h
diff --git a/headers/build/posix/math.h b/headers/build/posix/math.h new file mode 100644 index 0000000..a06411e
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_MATH_H 6 #define _HAIKU_BUILD_MATH_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <math.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_MATH_H */ -
new file headers/build/posix/memory.h
diff --git a/headers/build/posix/memory.h b/headers/build/posix/memory.h new file mode 100644 index 0000000..9444237
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_MEMORY_H 6 #define _HAIKU_BUILD_MEMORY_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <memory.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_MEMORY_H */ -
new file headers/build/posix/monetary.h
diff --git a/headers/build/posix/monetary.h b/headers/build/posix/monetary.h new file mode 100644 index 0000000..98f0326
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_MONETARY_H 6 #define _HAIKU_BUILD_MONETARY_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <monetary.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_MONETARY_H */ -
new file headers/build/posix/netdb.h
diff --git a/headers/build/posix/net/if.h b/headers/build/posix/net/if.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/net/if_dl.h b/headers/build/posix/net/if_dl.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/net/if_media.h b/headers/build/posix/net/if_media.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/net/if_types.h b/headers/build/posix/net/if_types.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/net/route.h b/headers/build/posix/net/route.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netdb.h b/headers/build/posix/netdb.h new file mode 100644 index 0000000..fd3002d
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_NETDB_H 6 #define _HAIKU_BUILD_NETDB_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <netdb.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_NETDB_H */ -
new file headers/build/posix/nl_types.h
diff --git a/headers/build/posix/netinet/icmp6.h b/headers/build/posix/netinet/icmp6.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/in.h b/headers/build/posix/netinet/in.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/ip.h b/headers/build/posix/netinet/ip.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/ip6.h b/headers/build/posix/netinet/ip6.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/ip_icmp.h b/headers/build/posix/netinet/ip_icmp.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/ip_var.h b/headers/build/posix/netinet/ip_var.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/tcp.h b/headers/build/posix/netinet/tcp.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet/udp.h b/headers/build/posix/netinet/udp.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/netinet6/in6.h b/headers/build/posix/netinet6/in6.h new file mode 100644 index 0000000..e69de29 diff --git a/headers/build/posix/nl_types.h b/headers/build/posix/nl_types.h new file mode 100644 index 0000000..c6ee61e
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_NL_TYPES_H 6 #define _HAIKU_BUILD_NL_TYPES_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <nl_types.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_NL_TYPES_H */ -
new file headers/build/posix/null.h
diff --git a/headers/build/posix/null.h b/headers/build/posix/null.h new file mode 100644 index 0000000..a71e64c
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_NULL_H 6 #define _HAIKU_BUILD_NULL_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 // not a standard header. 11 //# include_next <null.h> 12 #endif 13 14 15 #endif /* _HAIKU_BUILD_NULL_H */ -
new file headers/build/posix/poll.h
diff --git a/headers/build/posix/poll.h b/headers/build/posix/poll.h new file mode 100644 index 0000000..777f154
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_POLL_H 6 #define _HAIKU_BUILD_POLL_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <poll.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_POLL_H */ -
new file headers/build/posix/pthread.h
diff --git a/headers/build/posix/pthread.h b/headers/build/posix/pthread.h new file mode 100644 index 0000000..645fe08
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_PTHREAD_H 6 #define _HAIKU_BUILD_PTHREAD_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <pthread.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_PTHREAD_H */ -
new file headers/build/posix/pwd.h
diff --git a/headers/build/posix/pwd.h b/headers/build/posix/pwd.h new file mode 100644 index 0000000..283b505
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_PWD_H 6 #define _HAIKU_BUILD_PWD_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <pwd.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_PWD_H */ -
new file headers/build/posix/regex.h
diff --git a/headers/build/posix/regex.h b/headers/build/posix/regex.h new file mode 100644 index 0000000..cc2ccb7
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_REGEX_H 6 #define _HAIKU_BUILD_REGEX_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <regex.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_REGEX_H */ -
new file headers/build/posix/resolv.h
diff --git a/headers/build/posix/resolv.h b/headers/build/posix/resolv.h new file mode 100644 index 0000000..4f8c6ae
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_RESOLV_H 6 #define _HAIKU_BUILD_RESOLV_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <resolv.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_RESOLV_H */ -
new file headers/build/posix/sched.h
diff --git a/headers/build/posix/sched.h b/headers/build/posix/sched.h new file mode 100644 index 0000000..093735c
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SCHED_H 6 #define _HAIKU_BUILD_SCHED_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sched.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SCHED_H */ -
new file headers/build/posix/search.h
diff --git a/headers/build/posix/search.h b/headers/build/posix/search.h new file mode 100644 index 0000000..f83b754
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SEARCH_H 6 #define _HAIKU_BUILD_SEARCH_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <search.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SEARCH_H */ -
new file headers/build/posix/semaphore.h
diff --git a/headers/build/posix/semaphore.h b/headers/build/posix/semaphore.h new file mode 100644 index 0000000..5d4bae1
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SEMAPHORE_H 6 #define _HAIKU_BUILD_SEMAPHORE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <semaphore.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SEMAPHORE_H */ -
new file headers/build/posix/setjmp.h
diff --git a/headers/build/posix/setjmp.h b/headers/build/posix/setjmp.h new file mode 100644 index 0000000..c7ce3b1
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SETJMP_H 6 #define _HAIKU_BUILD_SETJMP_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <setjmp.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SETJMP_H */ -
new file headers/build/posix/shadow.h
diff --git a/headers/build/posix/shadow.h b/headers/build/posix/shadow.h new file mode 100644 index 0000000..1b69939
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SHADOW_H 6 #define _HAIKU_BUILD_SHADOW_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <shadow.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SHADOW_H */ -
new file headers/build/posix/signal.h
diff --git a/headers/build/posix/signal.h b/headers/build/posix/signal.h new file mode 100644 index 0000000..9556bce
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SIGNAL_H 6 #define _HAIKU_BUILD_SIGNAL_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <signal.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SIGNAL_H */ -
new file headers/build/posix/size_t.h
diff --git a/headers/build/posix/size_t.h b/headers/build/posix/size_t.h new file mode 100644 index 0000000..aeddf6b
- + 1 /* 2 * Copyright 2008-2011 Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SIZE_T_H 6 #define _HAIKU_BUILD_SIZE_T_H 7 8 9 #include <stddef.h> 10 11 12 /* ATM we don't define ssize_t for GCC2 */ 13 #if __GNUC__ > 2 /*&& !defined(__ssize_t__)*/ 14 /*# define __ssize_t__*/ 15 typedef long signed int haiku_build_ssize_t; 16 #endif 17 18 19 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 20 // not a standard header. 21 //# include_next <size_t.h> 22 #endif 23 24 25 #endif /* _HAIKU_BUILD_SIZE_T_H */ -
new file headers/build/posix/stdint.h
diff --git a/headers/build/posix/stdint.h b/headers/build/posix/stdint.h new file mode 100644 index 0000000..259d22e
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_STDINT_H 6 #define _HAIKU_BUILD_STDINT_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <stdint.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_STDINT_H */ -
new file headers/build/posix/stdio.h
diff --git a/headers/build/posix/stdio.h b/headers/build/posix/stdio.h new file mode 100644 index 0000000..83fc0e6
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_STDIO_H 6 #define _HAIKU_BUILD_STDIO_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <stdio.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_STDIO_H */ -
new file headers/build/posix/stdlib.h
diff --git a/headers/build/posix/stdlib.h b/headers/build/posix/stdlib.h new file mode 100644 index 0000000..dab098a
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_STDLIB_H 6 #define _HAIKU_BUILD_STDLIB_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <stdlib.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_STDLIB_H */ -
new file headers/build/posix/string.h
diff --git a/headers/build/posix/string.h b/headers/build/posix/string.h new file mode 100644 index 0000000..fd9d9da
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_STRING_H 6 #define _HAIKU_BUILD_STRING_H 7 8 9 #include <stddef.h> 10 11 #include <HaikuBuild.h> 12 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 19 _HAIKU_BUILD_DECLARE_FUNCTION( 20 size_t, strlcpy, (char* dest, const char* source, size_t length)) 21 _HAIKU_BUILD_DECLARE_FUNCTION( 22 size_t, strlcat, (char* dest, const char* source, size_t length)) 23 _HAIKU_BUILD_DECLARE_FUNCTION( 24 char*, stpcpy, (char* dest, const char* source)) 25 _HAIKU_BUILD_DECLARE_FUNCTION( 26 size_t, strnlen, (const char* string, size_t count)) 27 _HAIKU_BUILD_DECLARE_FUNCTION( 28 char*, strcasestr, (const char* string, const char* searchString)) 29 30 31 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 32 33 #include_next <string.h> 34 35 #ifndef _HAIKU_HOST_FEATURE_strlcpy 36 size_t strlcpy(char* dest, const char* source, size_t length); 37 #endif 38 39 #ifndef _HAIKU_HOST_FEATURE_strlcat 40 size_t strlcat(char* dest, const char* source, size_t length); 41 #endif 42 43 #ifndef _HAIKU_HOST_FEATURE_stpcpy 44 char* stpcpy(char* dest, const char* source); 45 #endif 46 47 #ifndef _HAIKU_HOST_FEATURE_strnlen 48 size_t strnlen(const char* string, size_t count); 49 #endif 50 51 #ifndef _HAIKU_HOST_FEATURE_strcasestr 52 char* strcasestr(const char* string, const char* searchString); 53 #endif 54 55 #endif // _HAIKU_BUILD_BUILD_LIBROOT 56 57 58 #ifdef __cplusplus 59 } /* extern "C" */ 60 #endif 61 62 #endif /* _HAIKU_BUILD_STRING_H */ -
new file headers/build/posix/strings.h
diff --git a/headers/build/posix/strings.h b/headers/build/posix/strings.h new file mode 100644 index 0000000..14dd2b9
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_STRINGS_H 6 #define _HAIKU_BUILD_STRINGS_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <strings.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_STRINGS_H */ -
new file headers/build/posix/sys/cdefs.h
diff --git a/headers/build/posix/sys/cdefs.h b/headers/build/posix/sys/cdefs.h new file mode 100644 index 0000000..8e32475
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_CDEFS_H 6 #define _HAIKU_BUILD_SYS_CDEFS_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/cdefs.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_CDEFS_H */ -
new file headers/build/posix/sys/file.h
diff --git a/headers/build/posix/sys/file.h b/headers/build/posix/sys/file.h new file mode 100644 index 0000000..e429b15
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_FILE_H 6 #define _HAIKU_BUILD_SYS_FILE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/file.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_FILE_H */ -
new file headers/build/posix/sys/ioctl.h
diff --git a/headers/build/posix/sys/ioctl.h b/headers/build/posix/sys/ioctl.h new file mode 100644 index 0000000..043cd77
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_IOCTL_H 6 #define _HAIKU_BUILD_SYS_IOCTL_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/ioctl.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_IOCTL_H */ -
new file headers/build/posix/sys/ipc.h
diff --git a/headers/build/posix/sys/ipc.h b/headers/build/posix/sys/ipc.h new file mode 100644 index 0000000..409ce5a
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_IPC_H 6 #define _HAIKU_BUILD_SYS_IPC_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/ipc.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_IPC_H */ -
new file headers/build/posix/sys/mman.h
diff --git a/headers/build/posix/sys/mman.h b/headers/build/posix/sys/mman.h new file mode 100644 index 0000000..7f8e0d1
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_MMAN_H 6 #define _HAIKU_BUILD_SYS_MMAN_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/mman.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_MMAN_H */ -
new file headers/build/posix/sys/msg.h
diff --git a/headers/build/posix/sys/msg.h b/headers/build/posix/sys/msg.h new file mode 100644 index 0000000..c0b21e9
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_MSG_H 6 #define _HAIKU_BUILD_SYS_MSG_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/msg.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_MSG_H */ -
new file headers/build/posix/sys/param.h
diff --git a/headers/build/posix/sys/param.h b/headers/build/posix/sys/param.h new file mode 100644 index 0000000..851ec20
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_PARAM_H 6 #define _HAIKU_BUILD_SYS_PARAM_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/param.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_PARAM_H */ -
new file headers/build/posix/sys/poll.h
diff --git a/headers/build/posix/sys/poll.h b/headers/build/posix/sys/poll.h new file mode 100644 index 0000000..25fd807
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_POLL_H 6 #define _HAIKU_BUILD_SYS_POLL_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/poll.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_POLL_H */ -
new file headers/build/posix/sys/resource.h
diff --git a/headers/build/posix/sys/resource.h b/headers/build/posix/sys/resource.h new file mode 100644 index 0000000..474f8bb
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_RESOURCE_H 6 #define _HAIKU_BUILD_SYS_RESOURCE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/resource.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_RESOURCE_H */ -
new file headers/build/posix/sys/select.h
diff --git a/headers/build/posix/sys/select.h b/headers/build/posix/sys/select.h new file mode 100644 index 0000000..aeebaea
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_SELECT_H 6 #define _HAIKU_BUILD_SYS_SELECT_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/select.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_SELECT_H */ -
new file headers/build/posix/sys/sem.h
diff --git a/headers/build/posix/sys/sem.h b/headers/build/posix/sys/sem.h new file mode 100644 index 0000000..522b504
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_SEM_H 6 #define _HAIKU_BUILD_SYS_SEM_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/sem.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_SEM_H */ -
new file headers/build/posix/sys/socket.h
diff --git a/headers/build/posix/sys/socket.h b/headers/build/posix/sys/socket.h new file mode 100644 index 0000000..3b10f2b
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_SOCKET_H 6 #define _HAIKU_BUILD_SYS_SOCKET_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/socket.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_SOCKET_H */ -
new file headers/build/posix/sys/sockio.h
diff --git a/headers/build/posix/sys/sockio.h b/headers/build/posix/sys/sockio.h new file mode 100644 index 0000000..26f63d6
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_SOCKIO_H 6 #define _HAIKU_BUILD_SYS_SOCKIO_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/sockio.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_SOCKIO_H */ -
new file headers/build/posix/sys/stat.h
diff --git a/headers/build/posix/sys/stat.h b/headers/build/posix/sys/stat.h new file mode 100644 index 0000000..d3394a9
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_STAT_H 6 #define _HAIKU_BUILD_SYS_STAT_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/stat.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_STAT_H */ -
new file headers/build/posix/sys/statvfs.h
diff --git a/headers/build/posix/sys/statvfs.h b/headers/build/posix/sys/statvfs.h new file mode 100644 index 0000000..36e6509
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_STATVFS_H 6 #define _HAIKU_BUILD_SYS_STATVFS_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/statvfs.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_STATVFS_H */ -
new file headers/build/posix/sys/time.h
diff --git a/headers/build/posix/sys/time.h b/headers/build/posix/sys/time.h new file mode 100644 index 0000000..149ba30
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_TIME_H 6 #define _HAIKU_BUILD_SYS_TIME_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/time.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_TIME_H */ -
new file headers/build/posix/sys/timeb.h
diff --git a/headers/build/posix/sys/timeb.h b/headers/build/posix/sys/timeb.h new file mode 100644 index 0000000..f0613a2
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_TIMEB_H 6 #define _HAIKU_BUILD_SYS_TIMEB_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/timeb.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_TIMEB_H */ -
new file headers/build/posix/sys/times.h
diff --git a/headers/build/posix/sys/times.h b/headers/build/posix/sys/times.h new file mode 100644 index 0000000..af6c9c6
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_TIMES_H 6 #define _HAIKU_BUILD_SYS_TIMES_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/times.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_TIMES_H */ -
new file headers/build/posix/sys/types.h
diff --git a/headers/build/posix/sys/types.h b/headers/build/posix/sys/types.h new file mode 100644 index 0000000..fc37830
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_TYPES_H 6 #define _HAIKU_BUILD_SYS_TYPES_H 7 8 9 #include <config_build/types.h> 10 11 #include <BeBuild.h> 12 13 14 /* BSD compatibility */ 15 typedef unsigned long haiku_build_u_long; 16 typedef unsigned int haiku_build_u_int; 17 typedef unsigned short haiku_build_u_short; 18 typedef unsigned char haiku_build_u_char; 19 20 21 /* sysV compatibility */ 22 typedef unsigned long haiku_build_ulong; 23 typedef unsigned short haiku_build_ushort; 24 typedef unsigned int haiku_build_uint; 25 typedef unsigned char haiku_build_unchar; 26 27 28 typedef __haiku_build_haiku_int64 haiku_build_blkcnt_t; 29 typedef __haiku_build_haiku_std_int32 haiku_build_blksize_t; 30 typedef __haiku_build_haiku_int64 haiku_build_fsblkcnt_t; 31 typedef __haiku_build_haiku_int64 haiku_build_fsfilcnt_t; 32 typedef __haiku_build_haiku_int64 haiku_build_off_t; 33 typedef __haiku_build_haiku_int64 haiku_build_ino_t; 34 typedef __haiku_build_haiku_std_int32 haiku_build_cnt_t; 35 typedef __haiku_build_haiku_int32 haiku_build_dev_t; 36 typedef __haiku_build_haiku_int32 haiku_build_pid_t; 37 typedef __haiku_build_haiku_int32 haiku_build_id_t; 38 39 typedef __haiku_build_haiku_std_uint32 haiku_build_uid_t; 40 typedef __haiku_build_haiku_std_uint32 haiku_build_gid_t; 41 typedef __haiku_build_haiku_std_uint32 haiku_build_mode_t; 42 typedef __haiku_build_haiku_std_uint32 haiku_build_umode_t; 43 typedef __haiku_build_haiku_std_int32 haiku_build_nlink_t; 44 45 #ifdef __HAIKU_BEOS_COMPATIBLE_TYPES 46 typedef int haiku_build_daddr_t; /* disk address */ 47 #else 48 typedef haiku_build_off_t haiku_build_daddr_t; /* disk address */ 49 #endif 50 typedef char* haiku_build_caddr_t; 51 52 typedef __haiku_build_haiku_addr_t haiku_build_addr_t; 53 typedef __haiku_build_haiku_int32 haiku_build_key_t; 54 55 typedef __haiku_build_haiku_std_int32 haiku_build_clockid_t; 56 typedef struct __haiku_build_timer_t* haiku_build_timer_t; 57 58 59 /* pthread types */ 60 61 typedef struct _haiku_build_pthread_thread *haiku_build_pthread_t; 62 typedef struct _haiku_build_pthread_attr *haiku_build_pthread_attr_t; 63 typedef struct _haiku_build_pthread_mutex haiku_build_pthread_mutex_t; 64 typedef struct _haiku_build_pthread_mutexattr *haiku_build_pthread_mutexattr_t; 65 typedef struct _haiku_build_pthread_cond haiku_build_pthread_cond_t; 66 typedef struct _haiku_build_pthread_condattr *haiku_build_pthread_condattr_t; 67 typedef int haiku_build_pthread_key_t; 68 typedef struct _haiku_build_pthread_once haiku_build_pthread_once_t; 69 typedef struct _haiku_build_pthread_rwlock haiku_build_pthread_rwlock_t; 70 typedef struct _haiku_build_pthread_rwlockattr *haiku_build_pthread_rwlockattr_t; 71 typedef struct _haiku_build_pthread_spinlock haiku_build_pthread_spinlock_t; 72 /* 73 typedef struct _haiku_build_pthread_barrier *haiku_build_pthread_barrier_t; 74 typedef struct _haiku_build_pthread_barrierattr *haiku_build_pthread_barrierattr_t; 75 */ 76 77 struct _haiku_build_pthread_mutex { 78 __haiku_build_haiku_std_uint32 flags; 79 __haiku_build_haiku_std_int32 lock; 80 __haiku_build_haiku_std_int32 unused; 81 __haiku_build_haiku_std_int32 owner; 82 __haiku_build_haiku_std_int32 owner_count; 83 }; 84 85 struct _haiku_build_pthread_cond { 86 __haiku_build_haiku_std_uint32 flags; 87 __haiku_build_haiku_std_int32 unused; 88 haiku_build_pthread_mutex_t* mutex; 89 __haiku_build_haiku_std_int32 waiter_count; 90 __haiku_build_haiku_std_int32 lock; 91 }; 92 93 struct _haiku_build_pthread_once { 94 __haiku_build_haiku_std_int32 state; 95 }; 96 97 struct _haiku_build_pthread_rwlock { 98 __haiku_build_haiku_std_uint32 flags; 99 __haiku_build_haiku_std_int32 owner; 100 union { 101 struct { 102 __haiku_build_haiku_std_int32 sem; 103 } shared; 104 struct { 105 __haiku_build_haiku_std_int32 lock_sem; 106 __haiku_build_haiku_std_int32 lock_count; 107 __haiku_build_haiku_std_int32 reader_count; 108 __haiku_build_haiku_std_int32 writer_count; 109 void* waiters[2]; 110 } local; 111 } u; 112 }; 113 114 struct _haiku_build_pthread_spinlock { 115 __haiku_build_haiku_std_int32 lock; 116 }; 117 118 119 #include <null.h> 120 #include <size_t.h> 121 #include <time.h> 122 123 124 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 125 # include_next <sys/types.h> 126 #endif 127 128 129 #endif /* _HAIKU_BUILD_SYS_TYPES_H */ -
new file headers/build/posix/sys/uio.h
diff --git a/headers/build/posix/sys/uio.h b/headers/build/posix/sys/uio.h new file mode 100644 index 0000000..5a62d0f
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_UIO_H 6 #define _HAIKU_BUILD_SYS_UIO_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/uio.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_UIO_H */ -
new file headers/build/posix/sys/un.h
diff --git a/headers/build/posix/sys/un.h b/headers/build/posix/sys/un.h new file mode 100644 index 0000000..e174ed8
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_UN_H 6 #define _HAIKU_BUILD_SYS_UN_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/un.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_UN_H */ -
new file headers/build/posix/sys/utsname.h
diff --git a/headers/build/posix/sys/utsname.h b/headers/build/posix/sys/utsname.h new file mode 100644 index 0000000..b44f3ab
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_UTSNAME_H 6 #define _HAIKU_BUILD_SYS_UTSNAME_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/utsname.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_UTSNAME_H */ -
new file headers/build/posix/sys/wait.h
diff --git a/headers/build/posix/sys/wait.h b/headers/build/posix/sys/wait.h new file mode 100644 index 0000000..e2dfc6d
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYS_WAIT_H 6 #define _HAIKU_BUILD_SYS_WAIT_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <sys/wait.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYS_WAIT_H */ -
new file headers/build/posix/syslog.h
diff --git a/headers/build/posix/syslog.h b/headers/build/posix/syslog.h new file mode 100644 index 0000000..b071c7c
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_SYSLOG_H 6 #define _HAIKU_BUILD_SYSLOG_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <syslog.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_SYSLOG_H */ -
new file headers/build/posix/termios.h
diff --git a/headers/build/posix/termios.h b/headers/build/posix/termios.h new file mode 100644 index 0000000..c06fc8d
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_TERMIOS_H 6 #define _HAIKU_BUILD_TERMIOS_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <termios.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_TERMIOS_H */ -
new file headers/build/posix/time.h
diff --git a/headers/build/posix/time.h b/headers/build/posix/time.h new file mode 100644 index 0000000..57ace36
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_TIME_H 6 #define _HAIKU_BUILD_TIME_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <time.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_TIME_H */ -
new file headers/build/posix/unistd.h
diff --git a/headers/build/posix/unistd.h b/headers/build/posix/unistd.h new file mode 100644 index 0000000..8f97986
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_UNISTD_H 6 #define _HAIKU_BUILD_UNISTD_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <unistd.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_UNISTD_H */ -
new file headers/build/posix/utime.h
diff --git a/headers/build/posix/utime.h b/headers/build/posix/utime.h new file mode 100644 index 0000000..a198496
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_UTIME_H 6 #define _HAIKU_BUILD_UTIME_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <utime.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_UTIME_H */ -
new file headers/build/posix/wchar.h
diff --git a/headers/build/posix/wchar.h b/headers/build/posix/wchar.h new file mode 100644 index 0000000..2c03351
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_WCHAR_H 6 #define _HAIKU_BUILD_WCHAR_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <wchar.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_WCHAR_H */ -
new file headers/build/posix/wchar_t.h
diff --git a/headers/build/posix/wchar_t.h b/headers/build/posix/wchar_t.h new file mode 100644 index 0000000..ebd111d
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_WCHAR_T_H 6 #define _HAIKU_BUILD_WCHAR_T_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <wchar_t.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_WCHAR_T_H */ -
new file headers/build/posix/wctype.h
diff --git a/headers/build/posix/wctype.h b/headers/build/posix/wctype.h new file mode 100644 index 0000000..200a60e
- + 1 /* 2 * Copyright 2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _HAIKU_BUILD_WCTYPE_H 6 #define _HAIKU_BUILD_WCTYPE_H 7 8 9 #ifdef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER 10 # include_next <wctype.h> 11 #endif 12 13 14 #endif /* _HAIKU_BUILD_WCTYPE_H */ -
src/build/Jamfile
diff --git a/src/build/Jamfile b/src/build/Jamfile index 17634b0..3b7aa4c 100644
a b 1 1 SubDir HAIKU_TOP src build ; 2 2 3 SubInclude HAIKU_TOP src build configure ; 3 4 SubInclude HAIKU_TOP src build libbe ; 4 5 SubInclude HAIKU_TOP src build libhaikucompat ; 5 6 SubInclude HAIKU_TOP src build libpackage ; -
new file src/build/configure/Jamfile
diff --git a/src/build/configure/Jamfile b/src/build/configure/Jamfile new file mode 100644 index 0000000..ea888d5
- + 1 SubDir HAIKU_TOP src build configure ; 2 3 HAIKU_BUILD_HOST_FEATURES = <build!configure>HostFeatures ; 4 MakeLocate $(HAIKU_BUILD_HOST_FEATURES) : $(HAIKU_BUILD_OUTPUT_DIR) ; 5 6 HAIKU_BUILD_CONFIG_HEADER = <build!configure>HaikuHostBuildConfig.h ; 7 MakeLocate $(HAIKU_BUILD_CONFIG_HEADER) : $(HAIKU_BUILD_OUTPUT_DIR) ; 8 9 local configureTargets ; 10 11 rule ConfigureCheckExists feature : fileTarget 12 { 13 local target = $(fileTarget:G=build!configure!test) ; 14 15 FEATURE on $(target) = $(feature) ; 16 NotFile $(target) ; 17 Depends $(target) : $(HAIKU_BUILD_CONFIG_HEADER) $(fileTarget) ; 18 19 ConfigureCheckExists1 $(target) 20 : $(HAIKU_BUILD_CONFIG_HEADER) $(fileTarget) ; 21 22 configureTargets += $(target) ; 23 } 24 25 26 actions ConfigureCheckExists1 27 { 28 if [ -f "$(2[2-])" ]; then 29 echo "#define _HAIKU_BUILD_FEATURE_$(FEATURE) 1" >> $(2[1]) 30 # echo $(FEATURE) >> $(2[1]) 31 fi 32 } 33 34 35 rule ConfigureTestCompile feature : sources : libraries 36 { 37 local executable = <build!configure>test_$(feature) ; 38 39 BuildPlatformMain $(executable) : $(sources) : $(libraries) ; 40 ConfigureCheckExists $(feature) : $(executable) ; 41 } 42 43 44 rule ConfigureCheckFunction function : code : headers : libraries 45 { 46 local source = [ FGristFiles test_$(function).cpp ] ; 47 CODE on $(source) = $(code) ; 48 HEADERS on $(source) = $(headers) ; 49 50 MakeLocateCommonPlatform $(source) ; 51 ConfigureCheckFunction1 $(source) ; 52 53 ConfigureTestCompile $(function) : $(source) : $(libraries) ; 54 } 55 56 57 actions ConfigureCheckFunction1 58 { 59 rm -f $(1) 60 for header in $(HEADERS); do 61 echo "#include <$header>" >> $(1) 62 done 63 64 cat << EOF >> $(1) 65 int main() 66 { 67 $(CODE) 68 return 0; 69 } 70 EOF 71 } 72 73 74 rule ConfigureRunProgram name : sources : libraries 75 { 76 local program = $(name:G=build!configure) ; 77 local target = $(name:G=build!configure!test) ; 78 79 BuildPlatformMain $(program) : $(sources) : $(libraries) ; 80 81 ConfigureRunProgram1 ; 82 83 NotFile $(target) ; 84 Depends $(target) : $(HAIKU_BUILD_CONFIG_HEADER) $(program) ; 85 86 ConfigureRunProgram1 $(target) : $(HAIKU_BUILD_CONFIG_HEADER) $(program) ; 87 88 configureTargets += $(target) ; 89 } 90 91 92 actions ConfigureRunProgram1 93 { 94 $(2[2-]) >> $(2[1]) 95 } 96 97 98 ConfigureCheckFunction strnlen 99 : "(void)strnlen(\"test\", 4);" 100 : string.h ; 101 102 ConfigureCheckFunction strlcpy 103 : "char buffer[10]; strlcpy(buffer, \"test\", sizeof(buffer));" 104 : string.h ; 105 106 ConfigureCheckFunction stpcpy 107 : "char buffer[10]; stpcpy(buffer, \"test\");" 108 : string.h ; 109 110 ConfigureCheckFunction strcasestr 111 : "(void)strcasestr(\"foo\", \"bar\");" 112 : string.h ; 113 114 ConfigureRunProgram test_int_types : test_int_types.cpp ; 115 116 117 Depends configure_build : $(configureTargets) ; 118 NotFile configure_build ; -
new file src/build/configure/test_int_types.cpp
diff --git a/src/build/configure/test_int_types.cpp b/src/build/configure/test_int_types.cpp new file mode 100644 index 0000000..6937c2b
- + 1 /* 2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include <inttypes.h> 8 #include <stdio.h> 9 10 11 template<typename Type> 12 struct TypeInfo { 13 static const char* const TypeName(); 14 static const char* const Prefix(); 15 }; 16 17 18 #define DEFINE_TYPE_INFO_TEMPLATE(type, prefix) \ 19 template<> \ 20 struct TypeInfo<type> { \ 21 static const char* const TypeName() \ 22 { \ 23 return #type; \ 24 } \ 25 static const char* const Prefix() \ 26 { \ 27 return prefix; \ 28 } \ 29 }; 30 31 #define DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(type, prefix) \ 32 DEFINE_TYPE_INFO_TEMPLATE(type, prefix) \ 33 DEFINE_TYPE_INFO_TEMPLATE(unsigned type, prefix) 34 35 36 DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(char, "") 37 DEFINE_TYPE_INFO_TEMPLATE(signed char, "") 38 DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(short, "") 39 DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(int, "") 40 DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(long, "l") 41 DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(long long, "ll") 42 43 44 template<typename Type> 45 struct PrintTypeInfo { 46 static void Print(const char* name) 47 { 48 printf("#define _HAIKU_BUILD_FEATURE_%s %s\n", name, 49 TypeInfo<Type>::TypeName()); 50 printf("#define _HAIKU_BUILD_FEATURE_FORMAT_PREFIX_%s \"%s\"\n", name, 51 TypeInfo<Type>::Prefix()); 52 } 53 }; 54 55 56 #define PRINT_TYPE_INFO(type) PrintTypeInfo<type##_t>::Print(#type) 57 58 #define PRINT_TYPE_INFO_SIGNED_AND_UNSIGNED(type) \ 59 PRINT_TYPE_INFO(type); \ 60 PRINT_TYPE_INFO(u##type) 61 62 63 int 64 main() 65 { 66 PRINT_TYPE_INFO_SIGNED_AND_UNSIGNED(int8); 67 PRINT_TYPE_INFO_SIGNED_AND_UNSIGNED(int16); 68 PRINT_TYPE_INFO_SIGNED_AND_UNSIGNED(int32); 69 PRINT_TYPE_INFO_SIGNED_AND_UNSIGNED(int64); 70 return 0; 71 } -
src/build/libroot/Jamfile
diff --git a/src/build/libroot/Jamfile b/src/build/libroot/Jamfile index e1ebd9d..99430ce 100644
a b 1 1 SubDir HAIKU_TOP src build libroot ; 2 2 3 UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; 4 UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ; 5 UseHeaders [ FDirName $(HAIKU_TOP) headers build os app ] : true ; 6 UseHeaders [ FDirName $(HAIKU_TOP) headers build os drivers ] : true ; 7 UseHeaders [ FDirName $(HAIKU_TOP) headers build os kernel ] : true ; 8 UseHeaders [ FDirName $(HAIKU_TOP) headers build os interface ] : true ; 9 UseHeaders [ FDirName $(HAIKU_TOP) headers build os storage ] : true ; 10 UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ; 3 # UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; 4 # UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; 5 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ; 6 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os app ] : true ; 7 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os drivers ] : true ; 8 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os kernel ] : true ; 9 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os interface ] : true ; 10 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os storage ] : true ; 11 # UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ; 12 UseHeaders $(HOST_BE_API_HEADERS) : true ; 11 13 12 14 UsePrivateBuildHeaders kernel system ; 13 15 16 #DEFINES += _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 ; 17 14 18 { 15 19 local defines = [ FDefines 16 20 HAIKU_BUILD_ATTRIBUTES_DIR="\\\"$(HAIKU_BUILD_ATTRIBUTES_DIR)\\\"" … … UsePrivateBuildHeaders kernel system ; 30 34 defines = [ FDefines KMESSAGE_CONTAINER_ONLY=1 ] ; 31 35 ObjectC++Flags KMessage.cpp : $(defines) ; 32 36 37 defines = [ FDefines _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 ] ; 38 ObjectC++Flags atomic.cpp : $(defines) ; 33 39 } 34 40 35 41 # locate the library 36 42 MakeLocate libroot_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ; 37 43 38 # darwin already has strlcpy and strlcat in libSystem44 # add string functions not provided by the host platform 39 45 local strlSources ; 40 if $(HOST_PLATFORM) != darwin { 41 strlSources = strlcpy.c strlcat.c ; 42 } 43 44 if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos { 45 strlSources += stpcpy.c strcasestr.c ; 46 local function ; 47 for function in strlcpy strlcat stpcpy strcasestr strnlen { 48 if $(HAIKU_HOST_FEATURE_$(function)) != 1 { 49 strlSources = $(function).c ; 50 } 46 51 } 47 52 48 53 local hostPlatformSources ; … … if $(HOST_PLATFORM) = freebsd { 53 58 local librootSources = 54 59 atomic.cpp 55 60 byteorder.cpp 56 errors.cpp61 # errors.cpp 57 62 find_directory.cpp 58 63 fs.cpp 59 64 fs_attr.cpp … … local librootSources = 67 72 driver_settings.cpp 68 73 69 74 $(strlSources) 70 strnlen.c71 75 72 76 KMessage.cpp 73 77 ; 74 78 75 USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ;79 #USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ; 76 80 77 81 BuildPlatformSharedLibrary libroot_build.so : 78 82 $(librootSources) … … BuildPlatformStaticLibrary libroot_build.a : 85 89 [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] 86 90 ; 87 91 88 USES_BE_API on [ FGristFiles function_remapper$(SUFOBJ) ] = true ;92 #USES_BE_API on [ FGristFiles function_remapper$(SUFOBJ) ] = true ; 89 93 90 94 BuildPlatformStaticLibraryPIC libroot_build_function_remapper.a : 91 95 function_remapper.cpp … … BuildPlatformStaticLibraryPIC libroot_build_function_remapper.a : 93 97 94 98 SEARCH on [ FGristFiles driver_settings.cpp ] 95 99 = [ FDirName $(HAIKU_TOP) src system libroot os ] ; 96 SEARCH on [ FGristFiles $(strlSources) strnlen.c]100 SEARCH on [ FGristFiles $(strlSources) ] 97 101 = [ FDirName $(HAIKU_TOP) src system libroot posix string ] ; 98 102 SEARCH on [ FGristFiles KMessage.cpp ] 99 103 = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ; -
src/build/libroot/atomic.cpp
diff --git a/src/build/libroot/atomic.cpp b/src/build/libroot/atomic.cpp index f7a7269..bbaef15 100644
a b 1 #include <BeOSBuildCompatibility.h>1 //#include <BeOSBuildCompatibility.h> 2 2 3 #include <string.h>3 //#include <string.h> 4 4 5 #include <OS.h>5 //#include <OS.h> 6 6 #include <SupportDefs.h> 7 7 8 8 9 int3210 atomic_set(vint32 *value,int32 newValue)9 haiku_build_int32 10 _haiku_build_atomic_set(haiku_build_vint32 *value, haiku_build_int32 newValue) 11 11 { 12 int32 oldValue = *value;12 haiku_build_int32 oldValue = *value; 13 13 *value = newValue; 14 14 return oldValue; 15 15 } 16 16 17 17 18 int32 19 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst) 18 haiku_build_int32 19 _haiku_build_atomic_test_and_set(haiku_build_vint32 *value, 20 haiku_build_int32 newValue, haiku_build_int32 testAgainst) 20 21 { 21 int32 oldValue = *value;22 haiku_build_int32 oldValue = *value; 22 23 if (oldValue == testAgainst) 23 24 *value = newValue; 24 25 return oldValue; 25 26 } 26 27 27 28 28 int3229 atomic_add(vint32 *value,int32 addValue)29 haiku_build_int32 30 _haiku_build_atomic_add(haiku_build_vint32 *value, haiku_build_int32 addValue) 30 31 { 31 int32 oldValue = *value;32 haiku_build_int32 oldValue = *value; 32 33 *value += addValue; 33 34 return oldValue; 34 35 } 35 36 36 37 37 int3238 atomic_and(vint32 *value,int32 andValue)38 haiku_build_int32 39 _haiku_build_atomic_and(haiku_build_vint32 *value, haiku_build_int32 andValue) 39 40 { 40 int32 oldValue = *value;41 haiku_build_int32 oldValue = *value; 41 42 *value &= andValue; 42 43 return oldValue; 43 44 } 44 45 45 46 46 int3247 atomic_or(vint32 *value,int32 orValue)47 haiku_build_int32 48 _haiku_build_atomic_or(haiku_build_vint32 *value, haiku_build_int32 orValue) 48 49 { 49 int32 oldValue = *value;50 haiku_build_int32 oldValue = *value; 50 51 *value |= orValue; 51 52 return oldValue; 52 53 } 53 54 54 55 55 int3256 atomic_get(vint32 *value)56 haiku_build_int32 57 _haiku_build_atomic_get(haiku_build_vint32 *value) 57 58 { 58 59 return *value; 59 60 } 60 61 61 62 62 int6463 atomic_set64(vint64 *value,int64 newValue)63 haiku_build_int64 64 _haiku_build_atomic_set64(haiku_build_vint64 *value, haiku_build_int64 newValue) 64 65 { 65 int64 oldValue = *value;66 haiku_build_int64 oldValue = *value; 66 67 *value = newValue; 67 68 return oldValue; 68 69 } 69 70 70 int64 71 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) 71 haiku_build_int64 72 _haiku_build_atomic_test_and_set64(haiku_build_vint64 *value, 73 haiku_build_int64 newValue, haiku_build_int64 testAgainst) 72 74 { 73 int64 oldValue = *value;75 haiku_build_int64 oldValue = *value; 74 76 if (oldValue == testAgainst) 75 77 *value = newValue; 76 78 return oldValue; 77 79 } 78 80 79 int6480 atomic_add64(vint64 *value,int64 addValue)81 haiku_build_int64 82 _haiku_build_atomic_add64(haiku_build_vint64 *value, haiku_build_int64 addValue) 81 83 { 82 int64 oldValue = *value;84 haiku_build_int64 oldValue = *value; 83 85 *value += addValue; 84 86 return oldValue; 85 87 } 86 88 87 int6488 atomic_and64(vint64 *value,int64 andValue)89 haiku_build_int64 90 _haiku_build_atomic_and64(haiku_build_vint64 *value, haiku_build_int64 andValue) 89 91 { 90 int64 oldValue = *value;92 haiku_build_int64 oldValue = *value; 91 93 *value &= andValue; 92 94 return oldValue; 93 95 } 94 96 95 int6496 atomic_or64(vint64 *value,int64 orValue)97 haiku_build_int64 98 _haiku_build_atomic_or64(haiku_build_vint64 *value, haiku_build_int64 orValue) 97 99 { 98 int64 oldValue = *value;100 haiku_build_int64 oldValue = *value; 99 101 *value |= orValue; 100 102 return oldValue; 101 103 } 102 104 103 int64104 atomic_get64(vint64 *value)105 haiku_build_int64 106 _haiku_build_atomic_get64(haiku_build_vint64 *value) 105 107 { 106 108 return *value; 107 109 } 108 -
src/build/libroot/byteorder.cpp
diff --git a/src/build/libroot/byteorder.cpp b/src/build/libroot/byteorder.cpp index fdcbf32..536b203 100644
a b 1 1 2 #ifdef BUILDING_FS_SHELL3 # include "compat.h"4 #else5 # include <BeOSBuildCompatibility.h>6 #endif2 //#ifdef BUILDING_FS_SHELL 3 //# include "compat.h" 4 //#else 5 //# include <BeOSBuildCompatibility.h> 6 //#endif 7 7 8 8 #include <ByteOrder.h> 9 9 10 uint1611 __ swap_int16(uint16 value)10 haiku_build_uint16 11 __haiku_build_swap_int16(haiku_build_uint16 value) 12 12 { 13 13 return (value >> 8) | (value << 8); 14 14 } 15 15 16 uint3217 __ swap_int32(uint32 value)16 haiku_build_uint32 17 __haiku_build_swap_int32(haiku_build_uint32 value) 18 18 { 19 19 return (value >> 24) | ((value & 0xff0000) >> 8) | ((value & 0xff00) << 8) 20 20 | (value << 24); 21 21 } 22 22 23 uint6424 __ swap_int64(uint64 value)23 haiku_build_uint64 24 __haiku_build_swap_int64(haiku_build_uint64 value) 25 25 { 26 return uint64(__swap_int32(uint32(value >> 32))) 27 | (uint64(__swap_int32(uint32(value))) << 32); 26 return haiku_build_uint64(__haiku_build_swap_int32(haiku_build_uint32( 27 value >> 32))) 28 | (haiku_build_uint64( 29 __haiku_build_swap_int32(haiku_build_uint32(value))) << 32); 28 30 } -
src/build/libroot/fs.cpp
diff --git a/src/build/libroot/fs.cpp b/src/build/libroot/fs.cpp index 5de5bfa..9377765 100644
a b 4 4 */ 5 5 6 6 7 #include <BeOSBuildCompatibility.h>7 //#include <BeOSBuildCompatibility.h> 8 8 9 9 #include "fs_impl.h" 10 10 … … 13 13 #include <fcntl.h> 14 14 #include <stdio.h> 15 15 #include <stdlib.h> 16 #include <string.h> 16 17 #include <unistd.h> 17 18 #include <utime.h> 18 19 #include <sys/stat.h> -
src/build/libroot/fs_attr_generic.cpp
diff --git a/src/build/libroot/fs_attr_generic.cpp b/src/build/libroot/fs_attr_generic.cpp index c43875b..3db1968 100644
a b 1 1 2 #include <BeOSBuildCompatibility.h>2 //#include <BeOSBuildCompatibility.h> 3 3 #include <syscalls.h> 4 4 5 5 #include <dirent.h> -
src/build/libroot/fs_attr_untyped.cpp
diff --git a/src/build/libroot/fs_attr_untyped.cpp b/src/build/libroot/fs_attr_untyped.cpp index 02ea2af..e47b30c 100644
a b 17 17 # define B_ENTRY_NOT_FOUND ENOENT 18 18 # define B_NO_MEMORY ENOMEM 19 19 #else 20 # include <BeOSBuildCompatibility.h>20 //# include <BeOSBuildCompatibility.h> 21 21 # include <syscalls.h> 22 22 23 23 # include "fs_impl.h" -
src/build/libroot/fs_descriptors.cpp
diff --git a/src/build/libroot/fs_descriptors.cpp b/src/build/libroot/fs_descriptors.cpp index 68103e3..06ba480 100644
a b 9 9 # define B_OK 0 10 10 # define B_FILE_ERROR EBADF 11 11 #else 12 # include <BeOSBuildCompatibility.h>12 //# include <BeOSBuildCompatibility.h> 13 13 #endif 14 14 15 15 #include "fs_descriptors.h" -
src/build/libroot/misc.cpp
diff --git a/src/build/libroot/misc.cpp b/src/build/libroot/misc.cpp index 7fae5be..fbfccba 100644
a b 1 1 2 #include <BeOSBuildCompatibility.h>2 //#include <BeOSBuildCompatibility.h> 3 3 4 4 #include <errno.h> 5 5 #include <stdio.h> -
src/build/libroot/sem.cpp
diff --git a/src/build/libroot/sem.cpp b/src/build/libroot/sem.cpp index 0e2d0c9..1a9116b 100644
a b 1 1 2 #include <BeOSBuildCompatibility.h>2 //#include <BeOSBuildCompatibility.h> 3 3 4 4 #include <stdlib.h> 5 5 #include <string.h> -
src/build/libroot/thread.cpp
diff --git a/src/build/libroot/thread.cpp b/src/build/libroot/thread.cpp index 7998694..438a541 100644
a b 1 1 2 #include <BeOSBuildCompatibility.h>2 //#include <BeOSBuildCompatibility.h> 3 3 4 4 #include <OS.h> 5 5