xref: /haiku/headers/build/HaikuBuildCompatibility.h (revision 55b40aa53a835472ec7952b138ae4256203d02e4)
1 #ifndef HAIKU_BUILD_COMPATIBILITY_H
2 #define HAIKU_BUILD_COMPATIBILITY_H
3 
4 #include <sys/types.h>
5 
6 #ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST
7 #	define _BE_ERRNO_H_
8 		// this is what Dano/Zeta is using
9 #	include <Errors.h>
10 #endif
11 
12 #include <string.h>
13 
14 // no addr_t under standard BeOS
15 typedef unsigned long haiku_build_addr_t;
16 #define addr_t haiku_build_addr_t
17 
18 #ifndef DEFFILEMODE
19 #	define	DEFFILEMODE	(S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
20 #endif
21 
22 #ifndef FS_WRITE_FSINFO_NAME
23 #	define	FS_WRITE_FSINFO_NAME	0x0001
24 #endif
25 
26 #ifndef B_CURRENT_TEAM
27 #	define B_CURRENT_TEAM	0
28 #endif
29 
30 
31 #ifndef SYMLOOP_MAX
32 #	define SYMLOOP_MAX	(16)
33 #endif
34 
35 #ifndef B_FIRST_REAL_TIME_PRIORITY
36 #	define B_FIRST_REAL_TIME_PRIORITY B_REAL_TIME_DISPLAY_PRIORITY
37 #endif
38 
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 extern size_t	strnlen(const char *string, size_t count);
45 
46 extern size_t	strlcat(char *dest, const char *source, size_t length);
47 extern size_t   strlcpy(char *dest, const char *source, size_t length);
48 
49 extern char		*strcasestr(const char *string, const char *searchString);
50 
51 extern float	roundf(float value);
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 // These are R1-specific extensions
58 #ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
59 #	define B_TRANSLATION_MAKE_VERSION(major,minor,revision) ((major << 8) | ((minor << 4) & 0xf0) | (revision & 0x0f))
60 #	define B_TRANSLATION_MAJOR_VERSION(v) (v >> 8)
61 #	define B_TRANSLATION_MINOR_VERSION(v) ((v >> 4) & 0xf)
62 #	define B_TRANSLATION_REVISION_VERSION(v) (v & 0xf)
63 #endif	// HAIKU_TARGET_PLATFORM_HAIKU
64 
65 #ifdef HAIKU_TARGET_PLATFORM_BEOS
66 #	define B_REDO 'REDO'
67 #	define B_BAD_DATA	(B_NOT_ALLOWED + 1)
68 #endif
69 
70 #ifndef INT64_MAX
71 #include <limits.h>
72 #define INT64_MAX LONGLONG_MAX
73 #endif
74 
75 #endif	// HAIKU_BUILD_COMPATIBILITY_H
76 
77