Ticket #8730: full-host-abstraction.diff

File full-host-abstraction.diff, 150.2 KB (added by bonefish, 12 years ago)

experimental state patch

  • 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) {  
    773773    HOST_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
    774774} else {
    775775    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 ;
    778778    HOST_LIBBE = libbe_build.so ;
    779779    if $(HOST_PLATFORM) = cygwin {
    780780        HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
    HOST_BE_API_C++FLAGS = ;  
    897897
    898898if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
    899899    HOST_BE_API_HEADERS =
     900        [ FDirName $(HAIKU_BUILD_OUTPUT_DIR) ]
    900901        [ FDirName $(HAIKU_TOP) headers build ]
     902        [ FDirName $(HAIKU_TOP) headers build posix ]
    901903        [ FDirName $(HAIKU_TOP) headers build os ]
    902904        [ FDirName $(HAIKU_TOP) headers build os app ]
    903905        [ FDirName $(HAIKU_TOP) headers build os drivers ]
    if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {  
    908910        [ FDirName $(HAIKU_TOP) headers build os support ]
    909911        [ FDirName $(HAIKU_TOP) headers build private ]
    910912    ;
    911     HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ;
     913#   HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ;
     914    HOST_BE_API_CCFLAGS += -nostdinc ;
    912915    HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ;
     916    HOST_BE_API_C++FLAGS += -nostdinc++ ;
    913917}
    914918
    915919# 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"  
    581581HAIKU_GCC_LIBGCC_OBJECTS    ?= ${HAIKU_GCC_LIBGCC_OBJECTS} ;
    582582EOF
    583583
    584 # Generate a boot strap Jamfile in the output directory.
     584# Generate a bootstrap Jamfile in the output directory.
    585585
    586586cat << EOF > $outputDir/Jamfile
    587587# automatically generated Jamfile
    HAIKU_OUTPUT_DIR = ${outputDir} ;  
    592592include [ FDirName \$(HAIKU_TOP) Jamfile ] ;
    593593
    594594EOF
     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
     613hostBuildConfigHeader=$outputDir/build/HaikuHostBuildConfig.h
     614cat << EOF > "$hostBuildConfigHeader"
     615/* auto-generated by configure */
     616#ifndef _HAIKU_BUILD_HOST_BUILD_CONFIG_H
     617#define _HAIKU_BUILD_HOST_BUILD_CONFIG_H
     618EOF
     619
     620jam -a configure_build
     621
     622cat << EOF >> "$hostBuildConfigHeader"
     623#endif  /* _HAIKU_BUILD_HOST_BUILD_CONFIG_H */
     624EOF
     625
     626
     627echo >> "$buildConfigFile"
     628cat "$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  
    11/*
    2  * Copyright 2009-2010, Haiku, Inc. All Rights Reserved.
     2 * Copyright 2009-2011, Haiku, Inc. All Rights Reserved.
    33 * Distributed under the terms of the MIT License.
    44 */
    55#ifndef _CONFIG_HAIKU_CONFIG_H
    66#define _CONFIG_HAIKU_CONFIG_H
    77
    88
     9#include <HaikuBuild.h>
     10
     11
    912/* Determine the architecture and define macros for some fundamental
    1013   properties:
    1114   __HAIKU_ARCH                 - short name of the architecture (used in paths)
     
    1821                                  (defaults to undefined)
    1922*/
    2023#ifdef __INTEL__
    21 #   define __HAIKU_ARCH             x86
    22 #   define __HAIKU_ARCH_X86         1
     24#   define __HAIKU_BUILD_HAIKU_ARCH             x86
     25#   define __HAIKU_BUILD_HAIKU_ARCH_X86         1
    2326#elif __x86_64__
    24 #   define __HAIKU_ARCH             x86_64
    25 #   define __HAIKU_ARCH_X86_64      1
    26 #   define __HAIKU_ARCH_BITS        64
     27#   define __HAIKU_BUILD_HAIKU_ARCH             x86_64
     28#   define __HAIKU_BUILD_HAIKU_ARCH_X86_64      1
     29#   define __HAIKU_BUILD_HAIKU_ARCH_BITS        64
    2730#elif __POWERPC__
    28 #   define __HAIKU_ARCH             ppc
    29 #   define __HAIKU_ARCH_PPC         1
    30 #   define __HAIKU_BIG_ENDIAN       1
     31#   define __HAIKU_BUILD_HAIKU_ARCH             ppc
     32#   define __HAIKU_BUILD_HAIKU_ARCH_PPC         1
     33#   define __HAIKU_BUILD_HAIKU_BIG_ENDIAN       1
    3134#elif __M68K__
    32 #   define __HAIKU_ARCH             m68k
    33 #   define __HAIKU_ARCH_M68K        1
    34 #   define __HAIKU_BIG_ENDIAN       1
     35#   define __HAIKU_BUILD_HAIKU_ARCH             m68k
     36#   define __HAIKU_BUILD_HAIKU_ARCH_M68K        1
     37#   define __HAIKU_BUILD_HAIKU_BIG_ENDIAN       1
    3538#elif __MIPSEL__
    36 #   define __HAIKU_ARCH             mipsel
    37 #   define __HAIKU_ARCH_MIPSEL      1
     39#   define __HAIKU_BUILD_HAIKU_ARCH             mipsel
     40#   define __HAIKU_BUILD_HAIKU_ARCH_MIPSEL      1
    3841#elif __ARM__
    39 #   define __HAIKU_ARCH             arm
    40 #   define __HAIKU_ARCH_ARM         1
     42#   define __HAIKU_BUILD_HAIKU_ARCH             arm
     43#   define __HAIKU_BUILD_HAIKU_ARCH_ARM         1
    4144#else
    4245#   error Unsupported architecture!
    4346#endif
     
    5356*/
    5457
    5558/* bitness */
    56 #ifndef __HAIKU_ARCH_BITS
    57 #   define __HAIKU_ARCH_BITS        32
     59#ifndef __HAIKU_BUILD_HAIKU_ARCH_BITS
     60#   define __HAIKU_BUILD_HAIKU_ARCH_BITS        32
    5861#endif
    5962
    60 #if __HAIKU_ARCH_BITS == 32
    61 #   define __HAIKU_ARCH_32_BIT      1
    62 #elif __HAIKU_ARCH_BITS == 64
    63 #   define __HAIKU_ARCH_64_BIT      1
     63#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
    6467#else
    6568#   error Unsupported bitness!
    6669#endif
    6770
    6871/* 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
    7175#endif
    7276
    73 #if __HAIKU_ARCH_PHYSICAL_BITS == 32
    74 #   define __HAIKU_ARCH_PHYSICAL_32_BIT 1
    75 #elif __HAIKU_ARCH_PHYSICAL_BITS == 64
    76 #   define __HAIKU_ARCH_PHYSICAL_64_BIT 1
     77#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
    7781#else
    7882#   error Unsupported physical bitness!
    7983#endif
    8084
    8185/* endianess */
    82 #ifndef __HAIKU_BIG_ENDIAN
    83 #   define  __HAIKU_LITTLE_ENDIAN   1
     86#ifndef __HAIKU_BUILD_HAIKU_BIG_ENDIAN
     87#   define  __HAIKU_BUILD_HAIKU_LITTLE_ENDIAN   1
    8488#endif
    8589
    8690/* 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)
    88154#define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header)  \
    89     <subdir/arch/__HAIKU_ARCH/header>
     155    __HAIKU_BUILD_HAIKU_SUBDIR_ARCH_HEADER(subdir, header)
    90156
     157#endif  /* _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER */
    91158
    92159#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  
    66#define _CONFIG_BUILD_TYPES_H
    77
    88
    9 #include <config_build/HaikuConfig.h>
     9#include <HaikuBuild.h>
    1010
    11 #include <inttypes.h>
     11#include <config_build/HaikuConfig.h>
    1212
    1313
    1414/* fixed-width types -- the __haiku_std_[u]int* types correspond to the POSIX
     
    1616   __HAIKU_BEOS_COMPATIBLE_TYPES is not defined both sets are identical. Once
    1717   we drop compatibility for good, we can consolidate the types.
    1818*/
    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;
     19typedef _HAIKU_BUILD_FEATURE_int8   __haiku_build_haiku_std_int8;
     20typedef _HAIKU_BUILD_FEATURE_uint8  __haiku_build_haiku_std_uint8;
     21typedef _HAIKU_BUILD_FEATURE_int16  __haiku_build_haiku_std_int16;
     22typedef _HAIKU_BUILD_FEATURE_uint16 __haiku_build_haiku_std_uint16;
     23typedef _HAIKU_BUILD_FEATURE_int32  __haiku_build_haiku_std_int32;
     24typedef _HAIKU_BUILD_FEATURE_uint32 __haiku_build_haiku_std_uint32;
     25typedef _HAIKU_BUILD_FEATURE_int64  __haiku_build_haiku_std_int64;
     26typedef _HAIKU_BUILD_FEATURE_uint64 __haiku_build_haiku_std_uint64;
     27
     28typedef __haiku_build_haiku_std_int8    __haiku_build_haiku_int8;
     29typedef __haiku_build_haiku_std_uint8   __haiku_build_haiku_uint8;
     30typedef __haiku_build_haiku_std_int16   __haiku_build_haiku_int16;
     31typedef __haiku_build_haiku_std_uint16  __haiku_build_haiku_uint16;
     32typedef __haiku_build_haiku_std_int32   __haiku_build_haiku_int32;
     33typedef __haiku_build_haiku_std_uint32  __haiku_build_haiku_uint32;
     34typedef __haiku_build_haiku_std_int64   __haiku_build_haiku_int64;
     35typedef __haiku_build_haiku_std_uint64  __haiku_build_haiku_uint64;
    3636
    3737/* address types */
    38 #ifdef __HAIKU_ARCH_64_BIT
    39     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;
    4141#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;
    4444#endif
    4545
    46 #ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
    47     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;
    4949#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;
    5252#endif
    5353
    5454/* address type limits */
    55 #ifdef __HAIKU_ARCH_64_BIT
    56 #   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)
    5858#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)
    6161#endif
    62 #define __HAIKU_SADDR_MIN           (-__HAIKU_SADDR_MAX-1)
     62#define __HAIKU_BUILD_HAIKU_SADDR_MIN       (-__HAIKU_BUILD_HAIKU_SADDR_MAX-1)
    6363
    64 #ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
    65 #   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)
    6767#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)
    7070#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)
    7272
    7373
    7474/* 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
    8088#else
    81 #   define __HAIKU_STD_PRI_PREFIX_64    "ll"
     89#   define __HAIKU_BUILD_HAIKU_PRI_PREFIX_ADDR  \
     90        __HAIKU_BUILD_HAIKU_PRI_PREFIX_32
    8291#endif
    8392
    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
    8996#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
    9799#endif
    98100
    99101
    100102/* 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
    105109#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
    109115#endif
    110116
    111117
     118/* map the macros/types, if not building the libroot mapper functions */
     119
     120#ifndef _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER
     121
     122typedef __haiku_build_haiku_std_int8    __haiku_std_int8;
     123typedef __haiku_build_haiku_std_uint8   __haiku_std_uint8;
     124typedef __haiku_build_haiku_std_int16   __haiku_std_int16;
     125typedef __haiku_build_haiku_std_uint16  __haiku_std_uint16;
     126typedef __haiku_build_haiku_std_int32   __haiku_std_int32;
     127typedef __haiku_build_haiku_std_uint32  __haiku_std_uint32;
     128typedef __haiku_build_haiku_std_int64   __haiku_std_int64;
     129typedef __haiku_build_haiku_std_uint64  __haiku_std_uint64;
     130
     131typedef __haiku_build_haiku_int8    __haiku_int8;
     132typedef __haiku_build_haiku_uint8   __haiku_uint8;
     133typedef __haiku_build_haiku_int16   __haiku_int16;
     134typedef __haiku_build_haiku_uint16  __haiku_uint16;
     135typedef __haiku_build_haiku_int32   __haiku_int32;
     136typedef __haiku_build_haiku_uint32  __haiku_uint32;
     137typedef __haiku_build_haiku_int64   __haiku_int64;
     138typedef __haiku_build_haiku_uint64  __haiku_uint64;
     139
     140typedef __haiku_build_haiku_saddr_t         __haiku_saddr_t;
     141typedef __haiku_build_haiku_addr_t          __haiku_addr_t;
     142typedef __haiku_build_haiku_phys_saddr_t    __haiku_phys_saddr_t;
     143typedef __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
     162typedef __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
    112169#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  
    22 * Copyright 2007-2010, Haiku, Inc. All Rights Reserved.
    33 * Distributed under the terms of the MIT License.
    44 */
    5 #ifndef _BE_BUILD_H
    6 #define _BE_BUILD_H
     5#ifndef _HAIKU_BUILD_BE_BUILD_H
     6#define _HAIKU_BUILD_BE_BUILD_H
    77
    88
    99#include <config_build/HaikuConfig.h>
    1010
    1111
    12 #define B_BEOS_VERSION_4                0x0400
    13 #define B_BEOS_VERSION_4_5              0x0450
    14 #define B_BEOS_VERSION_5                0x0500
     12#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
    1515
    16 #define B_BEOS_VERSION                  B_BEOS_VERSION_5
    17 #define B_BEOS_VERSION_MAUI             B_BEOS_VERSION_5
     16#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
    1818
    1919/* Haiku (API) version */
    20 #define B_HAIKU_VERSION_BEOS            0x00000001
    21 #define B_HAIKU_VERSION_BONE            0x00000002
    22 #define B_HAIKU_VERSION_DANO            0x00000003
    23 #define B_HAIKU_VERSION_1_ALPHA_1       0x00000100
    24 #define B_HAIKU_VERSION_1_PRE_ALPHA_2   0x00000101
    25 #define B_HAIKU_VERSION_1               0x00010000
     20#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
    2626
    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
    2829
    2930/* Haiku ABI */
    30 #define B_HAIKU_ABI_MAJOR               0xffff0000
    31 #define B_HAIKU_ABI_GCC_2               0x00020000
    32 #define B_HAIKU_ABI_GCC_4               0x00040000
     31#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
    3334
    34 #define B_HAIKU_ABI_GCC_2_ANCIENT       0x00020000
    35 #define B_HAIKU_ABI_GCC_2_BEOS          0x00020001
    36 #define B_HAIKU_ABI_GCC_2_HAIKU         0x00020002
     35#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
    3738
    3839#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
    4042#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
    4245#else
    4346#   error Unsupported gcc version!
    4447#endif
    4548
    4649
    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
    4954
    50 #ifdef __HAIKU_ARCH_64_BIT
    51 #   define B_HAIKU_64_BIT               1
     55#ifdef __HAIKU_BUILD_HAIKU_ARCH_64_BIT
     56#   define HAIKU_BUILD_B_HAIKU_64_BIT               1
    5257#else
    53 #   define B_HAIKU_32_BIT               1
     58#   define HAIKU_BUILD_B_HAIKU_32_BIT               1
    5459#endif
    5560
    56 #ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
    57 #   define B_HAIKU_PHYSICAL_64_BIT      1
     61#ifdef __HAIKU_BUILD_HAIKU_ARCH_PHYSICAL_64_BIT
     62#   define HAIKU_BUILD_B_HAIKU_PHYSICAL_64_BIT      1
    5863#else
    59 #   define B_HAIKU_PHYSICAL_32_BIT      1
     64#   define HAIKU_BUILD_B_HAIKU_PHYSICAL_32_BIT      1
    6065#endif
    6166
    62 #ifdef __HAIKU_BEOS_COMPATIBLE
    63 #   define B_HAIKU_BEOS_COMPATIBLE      1
     67#ifdef __HAIKU_BUILD_HAIKU_BEOS_COMPATIBLE
     68#   define HAIKU_BUILD_B_HAIKU_BEOS_COMPATIBLE      1
    6469#endif
    6570
    6671
    67 #define _UNUSED(argument) argument
    68 #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_) \
    7075    __attribute__((format(__printf__, _format_, _args_)))
    71 #define _EXPORT
    72 #define _IMPORT
     76#define _HAIKU_BUILD_EXPORT
     77#define _HAIKU_BUILD_IMPORT
    7378
    7479#define B_DEFINE_SYMBOL_VERSION(function, versionedSymbol)  \
    7580    __asm__(".symver " function "," versionedSymbol)
    7681
    7782
    78 #define _IMPEXP_ROOT
    79 #define _IMPEXP_BE
     83#define _HAIKU_BUILD_IMPEXP_ROOT
     84#define _HAIKU_BUILD_IMPEXP_BE
    8085
    8186
    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
     14typedef 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
     130extern "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
     253typedef haiku_build_directory_which directory_which;
     254
     255
     256/* C++ interface */
     257
     258#ifdef __cplusplus
     259
     260class BVolume;
     261class BPath;
     262
     263status_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 */
     17typedef 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
     133extern "C" {
     134#endif
     135
     136extern haiku_build_status_t haiku_build_swap_data(haiku_build_type_code type,
     137    void *data, size_t length, haiku_build_swap_action action);
     138extern bool haiku_build_is_type_swapped(haiku_build_type_code type);
     139
     140
     141/* Private implementations */
     142extern double __haiku_build_swap_double(double arg);
     143extern float  __haiku_build_swap_float(float arg);
     144extern haiku_build_uint64 __haiku_build_swap_int64(haiku_build_uint64 arg);
     145extern haiku_build_uint32 __haiku_build_swap_int32(haiku_build_uint32 arg);
     146extern 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
    107
    118
    12 #ifndef _ERRORS_H
    13 #define _ERRORS_H
    14 
    15 #include <errno.h>
    169#include <limits.h>
    1710
    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
    406327
    407328#ifdef __cplusplus
    408329extern "C" {
    409330#endif
    410331
    411 extern int *_haiku_build_errno();
    412 extern int _haiku_to_host_error(int error);
     332int _haiku_build_to_positive_error(int error);
     333int _haiku_build_to_negative_error(int error);
    413334
    414335#ifdef __cplusplus
    415336}
    416337#endif
    417338
    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
    112#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 */
     22typedef __haiku_build_haiku_int8            haiku_build_int8;
     23typedef __haiku_build_haiku_uint8           haiku_build_uint8;
     24typedef __haiku_build_haiku_int16           haiku_build_int16;
     25typedef __haiku_build_haiku_uint16          haiku_build_uint16;
     26typedef __haiku_build_haiku_int32           haiku_build_int32;
     27typedef __haiku_build_haiku_uint32          haiku_build_uint32;
     28typedef __haiku_build_haiku_int64           haiku_build_int64;
     29typedef __haiku_build_haiku_uint64          haiku_build_uint64;
     30
     31/* shorthand types */
     32typedef volatile haiku_build_int8           haiku_build_vint8;
     33typedef volatile haiku_build_uint8          haiku_build_vuint8;
     34typedef volatile haiku_build_int16          haiku_build_vint16;
     35typedef volatile haiku_build_uint16         haiku_build_vuint16;
     36typedef volatile haiku_build_int32          haiku_build_vint32;
     37typedef volatile haiku_build_uint32         haiku_build_vuint32;
     38typedef volatile haiku_build_int64          haiku_build_vint64;
     39typedef volatile haiku_build_uint64         haiku_build_vuint64;
     40
     41typedef volatile long           haiku_build_vlong;
     42typedef volatile int            haiku_build_vint;
     43typedef volatile short          haiku_build_vshort;
     44typedef volatile char           haiku_build_vchar;
     45
     46typedef volatile unsigned long  haiku_build_vulong;
     47typedef volatile unsigned int   haiku_build_vuint;
     48typedef volatile unsigned short haiku_build_vushort;
     49typedef volatile unsigned char  haiku_build_vuchar;
     50
     51typedef unsigned char           haiku_build_uchar;
     52typedef unsigned short          haiku_build_unichar;
     53
     54/* descriptive types */
     55typedef haiku_build_int32       haiku_build_status_t;
     56typedef haiku_build_int64       haiku_build_bigtime_t;
     57typedef haiku_build_int64       haiku_build_nanotime_t;
     58typedef haiku_build_uint32      haiku_build_type_code;
     59typedef haiku_build_uint32      haiku_build_perform_code;
     60
     61typedef __haiku_build_haiku_phys_addr_t     haiku_build_phys_addr_t;
     62typedef haiku_build_phys_addr_t             haiku_build_phys_size_t;
     63
     64typedef __haiku_build_haiku_generic_addr_t  haiku_build_generic_addr_t;
     65typedef 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
     159extern 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
     191extern "C" {
     192#endif
     193
     194/* Atomic functions; previous value is returned */
     195extern haiku_build_int32    haiku_build_atomic_set(haiku_build_vint32 *value,
     196                                haiku_build_int32 newValue);
     197extern haiku_build_int32    haiku_build_atomic_test_and_set(
     198                                haiku_build_vint32 *value,
     199                                haiku_build_int32 newValue,
     200                                haiku_build_int32 testAgainst);
     201extern haiku_build_int32    haiku_build_atomic_add(haiku_build_vint32 *value,
     202                                haiku_build_int32 addValue);
     203extern haiku_build_int32    haiku_build_atomic_and(haiku_build_vint32 *value,
     204                                haiku_build_int32 andValue);
     205extern haiku_build_int32    haiku_build_atomic_or(haiku_build_vint32 *value,
     206                                haiku_build_int32 orValue);
     207extern haiku_build_int32    haiku_build_atomic_get(haiku_build_vint32 *value);
     208
     209extern haiku_build_int64    haiku_build_atomic_set64(haiku_build_vint64 *value,
     210                                haiku_build_int64 newValue);
     211extern haiku_build_int64    haiku_build_atomic_test_and_set64(
     212                                haiku_build_vint64 *value,
     213                                haiku_build_int64 newValue,
     214                                haiku_build_int64 testAgainst);
     215extern haiku_build_int64    haiku_build_atomic_add64(haiku_build_vint64 *value,
     216                                haiku_build_int64 addValue);
     217extern haiku_build_int64    haiku_build_atomic_and64(haiku_build_vint64 *value,
     218                                haiku_build_int64 andValue);
     219extern haiku_build_int64    haiku_build_atomic_or64(haiku_build_vint64 *value,
     220                                haiku_build_int64 orValue);
     221extern haiku_build_int64    haiku_build_atomic_get64(haiku_build_vint64 *value);
     222
     223/* Other stuff */
     224extern 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__*/
     15typedef 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
     15extern "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
     36size_t  strlcpy(char* dest, const char* source, size_t length);
     37#endif
     38
     39#ifndef _HAIKU_HOST_FEATURE_strlcat
     40size_t  strlcat(char* dest, const char* source, size_t length);
     41#endif
     42
     43#ifndef _HAIKU_HOST_FEATURE_stpcpy
     44char*   stpcpy(char* dest, const char* source);
     45#endif
     46
     47#ifndef _HAIKU_HOST_FEATURE_strnlen
     48size_t  strnlen(const char* string, size_t count);
     49#endif
     50
     51#ifndef _HAIKU_HOST_FEATURE_strcasestr
     52char*   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 */
     15typedef unsigned long       haiku_build_u_long;
     16typedef unsigned int        haiku_build_u_int;
     17typedef unsigned short      haiku_build_u_short;
     18typedef unsigned char       haiku_build_u_char;
     19
     20
     21/* sysV compatibility */
     22typedef unsigned long       haiku_build_ulong;
     23typedef unsigned short      haiku_build_ushort;
     24typedef unsigned int        haiku_build_uint;
     25typedef unsigned char       haiku_build_unchar;
     26
     27
     28typedef __haiku_build_haiku_int64       haiku_build_blkcnt_t;
     29typedef __haiku_build_haiku_std_int32   haiku_build_blksize_t;
     30typedef __haiku_build_haiku_int64       haiku_build_fsblkcnt_t;
     31typedef __haiku_build_haiku_int64       haiku_build_fsfilcnt_t;
     32typedef __haiku_build_haiku_int64       haiku_build_off_t;
     33typedef __haiku_build_haiku_int64       haiku_build_ino_t;
     34typedef __haiku_build_haiku_std_int32   haiku_build_cnt_t;
     35typedef __haiku_build_haiku_int32       haiku_build_dev_t;
     36typedef __haiku_build_haiku_int32       haiku_build_pid_t;
     37typedef __haiku_build_haiku_int32       haiku_build_id_t;
     38
     39typedef __haiku_build_haiku_std_uint32  haiku_build_uid_t;
     40typedef __haiku_build_haiku_std_uint32  haiku_build_gid_t;
     41typedef __haiku_build_haiku_std_uint32  haiku_build_mode_t;
     42typedef __haiku_build_haiku_std_uint32  haiku_build_umode_t;
     43typedef __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
     50typedef char*               haiku_build_caddr_t;
     51
     52typedef __haiku_build_haiku_addr_t      haiku_build_addr_t;
     53typedef __haiku_build_haiku_int32       haiku_build_key_t;
     54
     55typedef __haiku_build_haiku_std_int32   haiku_build_clockid_t;
     56typedef struct __haiku_build_timer_t*   haiku_build_timer_t;
     57
     58
     59/* pthread types */
     60
     61typedef struct  _haiku_build_pthread_thread     *haiku_build_pthread_t;
     62typedef struct  _haiku_build_pthread_attr       *haiku_build_pthread_attr_t;
     63typedef struct  _haiku_build_pthread_mutex      haiku_build_pthread_mutex_t;
     64typedef struct  _haiku_build_pthread_mutexattr  *haiku_build_pthread_mutexattr_t;
     65typedef struct  _haiku_build_pthread_cond       haiku_build_pthread_cond_t;
     66typedef struct  _haiku_build_pthread_condattr   *haiku_build_pthread_condattr_t;
     67typedef int                         haiku_build_pthread_key_t;
     68typedef struct  _haiku_build_pthread_once       haiku_build_pthread_once_t;
     69typedef struct  _haiku_build_pthread_rwlock     haiku_build_pthread_rwlock_t;
     70typedef struct  _haiku_build_pthread_rwlockattr *haiku_build_pthread_rwlockattr_t;
     71typedef struct  _haiku_build_pthread_spinlock   haiku_build_pthread_spinlock_t;
     72/*
     73typedef struct  _haiku_build_pthread_barrier    *haiku_build_pthread_barrier_t;
     74typedef struct  _haiku_build_pthread_barrierattr *haiku_build_pthread_barrierattr_t;
     75*/
     76
     77struct _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
     85struct _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
     93struct _haiku_build_pthread_once {
     94    __haiku_build_haiku_std_int32   state;
     95};
     96
     97struct _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
     114struct _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  
    11SubDir HAIKU_TOP src build ;
    22
     3SubInclude HAIKU_TOP src build configure ;
    34SubInclude HAIKU_TOP src build libbe ;
    45SubInclude HAIKU_TOP src build libhaikucompat ;
    56SubInclude 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
    - +  
     1SubDir HAIKU_TOP src build configure ;
     2
     3HAIKU_BUILD_HOST_FEATURES = <build!configure>HostFeatures ;
     4MakeLocate $(HAIKU_BUILD_HOST_FEATURES) : $(HAIKU_BUILD_OUTPUT_DIR) ;
     5
     6HAIKU_BUILD_CONFIG_HEADER = <build!configure>HaikuHostBuildConfig.h ;
     7MakeLocate $(HAIKU_BUILD_CONFIG_HEADER) : $(HAIKU_BUILD_OUTPUT_DIR) ;
     8
     9local configureTargets ;
     10
     11rule 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
     26actions 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
     35rule 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
     44rule 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
     57actions 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
     74rule 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
     92actions ConfigureRunProgram1
     93{
     94    $(2[2-]) >> $(2[1])
     95}
     96
     97
     98ConfigureCheckFunction strnlen
     99    : "(void)strnlen(\"test\", 4);"
     100    : string.h ;
     101
     102ConfigureCheckFunction strlcpy
     103    : "char buffer[10]; strlcpy(buffer, \"test\", sizeof(buffer));"
     104    : string.h ;
     105
     106ConfigureCheckFunction stpcpy
     107    : "char buffer[10]; stpcpy(buffer, \"test\");"
     108    : string.h ;
     109
     110ConfigureCheckFunction strcasestr
     111    : "(void)strcasestr(\"foo\", \"bar\");"
     112    : string.h ;
     113
     114ConfigureRunProgram test_int_types : test_int_types.cpp ;
     115
     116
     117Depends configure_build : $(configureTargets) ;
     118NotFile 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
     11template<typename Type>
     12struct 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
     36DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(char, "")
     37DEFINE_TYPE_INFO_TEMPLATE(signed char, "")
     38DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(short, "")
     39DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(int, "")
     40DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(long, "l")
     41DEFINE_TYPE_INFO_TEMPLATE_SIGNED_AND_UNSIGNED(long long, "ll")
     42
     43
     44template<typename Type>
     45struct 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
     63int
     64main()
     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  
    11SubDir HAIKU_TOP src build libroot ;
    22
    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 ;
     12UseHeaders $(HOST_BE_API_HEADERS) : true ;
    1113
    1214UsePrivateBuildHeaders kernel system ;
    1315
     16#DEFINES += _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 ;
     17
    1418{
    1519    local defines = [ FDefines
    1620        HAIKU_BUILD_ATTRIBUTES_DIR="\\\"$(HAIKU_BUILD_ATTRIBUTES_DIR)\\\""
    UsePrivateBuildHeaders kernel system ;  
    3034    defines = [ FDefines KMESSAGE_CONTAINER_ONLY=1 ] ;
    3135    ObjectC++Flags KMessage.cpp : $(defines) ;
    3236
     37    defines = [ FDefines _HAIKU_BUILD_LIBROOT_FUNCTION_WRAPPER=1 ] ;
     38    ObjectC++Flags atomic.cpp : $(defines) ;
    3339}
    3440
    3541# locate the library
    3642MakeLocate libroot_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ;
    3743
    38 # darwin already has strlcpy and strlcat in libSystem
     44# add string functions not provided by the host platform
    3945local 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 ;
     46local function ;
     47for function in strlcpy strlcat stpcpy strcasestr strnlen {
     48    if $(HAIKU_HOST_FEATURE_$(function)) != 1 {
     49        strlSources = $(function).c ;
     50    }
    4651}
    4752
    4853local hostPlatformSources ;
    if $(HOST_PLATFORM) = freebsd {  
    5358local librootSources =
    5459    atomic.cpp
    5560    byteorder.cpp
    56     errors.cpp
     61#   errors.cpp
    5762    find_directory.cpp
    5863    fs.cpp
    5964    fs_attr.cpp
    local librootSources =  
    6772    driver_settings.cpp
    6873
    6974    $(strlSources)
    70     strnlen.c
    7175
    7276    KMessage.cpp
    7377;
    7478
    75 USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ;
     79#USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ;
    7680
    7781BuildPlatformSharedLibrary libroot_build.so :
    7882    $(librootSources)
    BuildPlatformStaticLibrary libroot_build.a :  
    8589    [ FGristFiles $(librootSources:S=$(SUFOBJ)) ]
    8690;
    8791
    88 USES_BE_API on [ FGristFiles function_remapper$(SUFOBJ) ] = true ;
     92#USES_BE_API on [ FGristFiles function_remapper$(SUFOBJ) ] = true ;
    8993
    9094BuildPlatformStaticLibraryPIC libroot_build_function_remapper.a :
    9195    function_remapper.cpp
    BuildPlatformStaticLibraryPIC libroot_build_function_remapper.a :  
    9397
    9498SEARCH on [ FGristFiles driver_settings.cpp ]
    9599    = [ FDirName $(HAIKU_TOP) src system libroot os ] ;
    96 SEARCH on [ FGristFiles $(strlSources) strnlen.c ]
     100SEARCH on [ FGristFiles $(strlSources) ]
    97101    = [ FDirName $(HAIKU_TOP) src system libroot posix string ] ;
    98102SEARCH on [ FGristFiles KMessage.cpp ]
    99103    = [ 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>
    22
    3 #include <string.h>
     3//#include <string.h>
    44
    5 #include <OS.h>
     5//#include <OS.h>
    66#include <SupportDefs.h>
    77
    88
    9 int32
    10 atomic_set(vint32 *value, int32 newValue)
     9haiku_build_int32
     10_haiku_build_atomic_set(haiku_build_vint32 *value, haiku_build_int32 newValue)
    1111{
    12     int32 oldValue = *value;
     12    haiku_build_int32 oldValue = *value;
    1313    *value = newValue;
    1414    return oldValue;
    1515}
    1616
    1717
    18 int32
    19 atomic_test_and_set(vint32 *value, int32 newValue, int32 testAgainst)
     18haiku_build_int32
     19_haiku_build_atomic_test_and_set(haiku_build_vint32 *value,
     20    haiku_build_int32 newValue, haiku_build_int32 testAgainst)
    2021{
    21     int32 oldValue = *value;
     22    haiku_build_int32 oldValue = *value;
    2223    if (oldValue == testAgainst)
    2324        *value = newValue;
    2425    return oldValue;
    2526}
    2627
    2728
    28 int32
    29 atomic_add(vint32 *value, int32 addValue)
     29haiku_build_int32
     30_haiku_build_atomic_add(haiku_build_vint32 *value, haiku_build_int32 addValue)
    3031{
    31     int32 oldValue = *value;
     32    haiku_build_int32 oldValue = *value;
    3233    *value += addValue;
    3334    return oldValue;
    3435}
    3536
    3637
    37 int32
    38 atomic_and(vint32 *value, int32 andValue)
     38haiku_build_int32
     39_haiku_build_atomic_and(haiku_build_vint32 *value, haiku_build_int32 andValue)
    3940{
    40     int32 oldValue = *value;
     41    haiku_build_int32 oldValue = *value;
    4142    *value &= andValue;
    4243    return oldValue;
    4344}
    4445
    4546
    46 int32
    47 atomic_or(vint32 *value, int32 orValue)
     47haiku_build_int32
     48_haiku_build_atomic_or(haiku_build_vint32 *value, haiku_build_int32 orValue)   
    4849{
    49     int32 oldValue = *value;
     50    haiku_build_int32 oldValue = *value;
    5051    *value |= orValue;
    5152    return oldValue;
    5253}
    5354
    5455
    55 int32
    56 atomic_get(vint32 *value)
     56haiku_build_int32
     57_haiku_build_atomic_get(haiku_build_vint32 *value)
    5758{
    5859    return *value;
    5960}
    6061
    6162
    62 int64
    63 atomic_set64(vint64 *value, int64 newValue)
     63haiku_build_int64
     64_haiku_build_atomic_set64(haiku_build_vint64 *value, haiku_build_int64 newValue)
    6465{
    65     int64 oldValue = *value;
     66    haiku_build_int64 oldValue = *value;
    6667    *value = newValue;
    6768    return oldValue;
    6869}
    6970
    70 int64
    71 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst)
     71haiku_build_int64
     72_haiku_build_atomic_test_and_set64(haiku_build_vint64 *value,
     73    haiku_build_int64 newValue, haiku_build_int64 testAgainst)
    7274{
    73     int64 oldValue = *value;
     75    haiku_build_int64 oldValue = *value;
    7476    if (oldValue == testAgainst)
    7577        *value = newValue;
    7678    return oldValue;
    7779}
    7880
    79 int64
    80 atomic_add64(vint64 *value, int64 addValue)
     81haiku_build_int64
     82_haiku_build_atomic_add64(haiku_build_vint64 *value, haiku_build_int64 addValue)
    8183{
    82     int64 oldValue = *value;
     84    haiku_build_int64 oldValue = *value;
    8385    *value += addValue;
    8486    return oldValue;
    8587}
    8688
    87 int64
    88 atomic_and64(vint64 *value, int64 andValue)
     89haiku_build_int64
     90_haiku_build_atomic_and64(haiku_build_vint64 *value, haiku_build_int64 andValue)
    8991{
    90     int64 oldValue = *value;
     92    haiku_build_int64 oldValue = *value;
    9193    *value &= andValue;
    9294    return oldValue;
    9395}
    9496
    95 int64
    96 atomic_or64(vint64 *value, int64 orValue)
     97haiku_build_int64
     98_haiku_build_atomic_or64(haiku_build_vint64 *value, haiku_build_int64 orValue)
    9799{
    98     int64 oldValue = *value;
     100    haiku_build_int64 oldValue = *value;
    99101    *value |= orValue;
    100102    return oldValue;
    101103}
    102104
    103 int64
    104 atomic_get64(vint64 *value)
     105haiku_build_int64
     106_haiku_build_atomic_get64(haiku_build_vint64 *value)
    105107{
    106108    return *value;
    107109}
    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  
    11
    2 #ifdef BUILDING_FS_SHELL
    3 #   include "compat.h"
    4 #else
    5 #   include <BeOSBuildCompatibility.h>
    6 #endif
     2//#ifdef BUILDING_FS_SHELL
     3//# include "compat.h"
     4//#else
     5//# include <BeOSBuildCompatibility.h>
     6//#endif
    77
    88#include <ByteOrder.h>
    99
    10 uint16
    11 __swap_int16(uint16 value)
     10haiku_build_uint16
     11__haiku_build_swap_int16(haiku_build_uint16 value)
    1212{
    1313    return (value >> 8) | (value << 8);
    1414}
    1515
    16 uint32
    17 __swap_int32(uint32 value)
     16haiku_build_uint32
     17__haiku_build_swap_int32(haiku_build_uint32 value)
    1818{
    1919    return (value >> 24) | ((value & 0xff0000) >> 8) | ((value & 0xff00) << 8)
    2020        | (value << 24);
    2121}
    2222
    23 uint64
    24 __swap_int64(uint64 value)
     23haiku_build_uint64
     24__haiku_build_swap_int64(haiku_build_uint64 value)
    2525{
    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);
    2830}
  • 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  
    44 */
    55
    66
    7 #include <BeOSBuildCompatibility.h>
     7//#include <BeOSBuildCompatibility.h>
    88
    99#include "fs_impl.h"
    1010
     
    1313#include <fcntl.h>
    1414#include <stdio.h>
    1515#include <stdlib.h>
     16#include <string.h>
    1617#include <unistd.h>
    1718#include <utime.h>
    1819#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  
    11
    2 #include <BeOSBuildCompatibility.h>
     2//#include <BeOSBuildCompatibility.h>
    33#include <syscalls.h>
    44
    55#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  
    1717#   define B_ENTRY_NOT_FOUND    ENOENT
    1818#   define B_NO_MEMORY          ENOMEM
    1919#else
    20 #   include <BeOSBuildCompatibility.h>
     20//# include <BeOSBuildCompatibility.h>
    2121#   include <syscalls.h>
    2222
    2323#   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  
    99#   define B_OK         0
    1010#   define B_FILE_ERROR EBADF
    1111#else
    12 #   include <BeOSBuildCompatibility.h>
     12//# include <BeOSBuildCompatibility.h>
    1313#endif
    1414
    1515#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  
    11
    2 #include <BeOSBuildCompatibility.h>
     2//#include <BeOSBuildCompatibility.h>
    33
    44#include <errno.h>
    55#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  
    11
    2 #include <BeOSBuildCompatibility.h>
     2//#include <BeOSBuildCompatibility.h>
    33
    44#include <stdlib.h>
    55#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  
    11
    2 #include <BeOSBuildCompatibility.h>
     2//#include <BeOSBuildCompatibility.h>
    33
    44#include <OS.h>
    55