1 #ifndef HAIKU_BUILD_COMPATIBILITY_H 2 #define HAIKU_BUILD_COMPATIBILITY_H 3 4 #include <sys/types.h> 5 #include <SupportDefs.h> 6 7 #ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST 8 # define _BE_ERRNO_H_ 9 // this is what Dano/Zeta is using 10 # include <Errors.h> 11 #endif 12 13 #include <string.h> 14 15 // no addr_t under standard BeOS 16 typedef unsigned long haiku_build_addr_t; 17 #define addr_t haiku_build_addr_t 18 19 #ifndef DEFFILEMODE 20 # define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) 21 #endif 22 23 #ifndef FS_WRITE_FSINFO_NAME 24 # define FS_WRITE_FSINFO_NAME 0x0001 25 #endif 26 27 #ifndef B_CURRENT_TEAM 28 # define B_CURRENT_TEAM 0 29 #endif 30 31 32 #ifndef SYMLOOP_MAX 33 # define SYMLOOP_MAX (16) 34 #endif 35 36 #ifndef B_FIRST_REAL_TIME_PRIORITY 37 # define B_FIRST_REAL_TIME_PRIORITY B_REAL_TIME_DISPLAY_PRIORITY 38 #endif 39 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 extern int32 atomic_set(vint32 *value, int32 newValue); 46 extern int32 atomic_test_and_set(vint32 *value, int32 newValue, 47 int32 testAgainst); 48 extern int32 atomic_get(vint32 *value); 49 50 extern size_t strnlen(const char *string, size_t count); 51 52 extern size_t strlcat(char *dest, const char *source, size_t length); 53 extern size_t strlcpy(char *dest, const char *source, size_t length); 54 55 extern char *strcasestr(const char *string, const char *searchString); 56 57 extern float roundf(float value); 58 59 #ifdef __cplusplus 60 } 61 #endif 62 63 // These are R1-specific extensions 64 #ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST 65 # define B_TRANSLATION_MAKE_VERSION(major,minor,revision) ((major << 8) | ((minor << 4) & 0xf0) | (revision & 0x0f)) 66 # define B_TRANSLATION_MAJOR_VERSION(v) (v >> 8) 67 # define B_TRANSLATION_MINOR_VERSION(v) ((v >> 4) & 0xf) 68 # define B_TRANSLATION_REVISION_VERSION(v) (v & 0xf) 69 # define B_LARGE_ICON_TYPE 'ICON' 70 # define B_MINI_ICON_TYPE 'MICN' 71 # define B_VECTOR_ICON_TYPE 'VICN' 72 # define B_BITMAP_NO_SERVER_LINK 0 73 #endif // HAIKU_TARGET_PLATFORM_LIBBE_TEST 74 75 #if defined(HAIKU_TARGET_PLATFORM_BEOS) || defined(HAIKU_TARGET_PLATFORM_BONE) 76 # define B_REDO 'REDO' 77 # define B_BAD_DATA (B_NOT_ALLOWED + 1) 78 #endif 79 80 #if !defined(HAIKU_TARGET_PLATFORM_HAIKU) && !defined(HAIKU_TARGET_PLATFORM_LIBBE_TEST) 81 #ifndef B_VECTOR_ICON_TYPE 82 #define B_VECTOR_ICON_TYPE 'VICN' 83 #endif 84 #endif 85 86 #ifndef INT64_MAX 87 #include <limits.h> 88 #define INT64_MAX LONGLONG_MAX 89 #endif 90 91 #define B_MPEG_2_AUDIO_LAYER_1 (enum mpeg_id)0x201 92 #define B_MPEG_2_AUDIO_LAYER_2 (enum mpeg_id)0x202 93 #define B_MPEG_2_AUDIO_LAYER_3 (enum mpeg_id)0x203 94 #define B_MPEG_2_VIDEO (enum mpeg_id)0x211 95 #define B_MPEG_2_5_AUDIO_LAYER_1 (enum mpeg_id)0x301 96 #define B_MPEG_2_5_AUDIO_LAYER_2 (enum mpeg_id)0x302 97 #define B_MPEG_2_5_AUDIO_LAYER_3 (enum mpeg_id)0x303 98 99 100 #endif // HAIKU_BUILD_COMPATIBILITY_H 101 102