… | |
… | |
8 | /* |
8 | /* |
9 | * Some handy, nonstandard functions. Note that the original may |
9 | * Some handy, nonstandard functions. Note that the original may |
10 | * be both faster and better. ``better'', if your compiler allows |
10 | * be both faster and better. ``better'', if your compiler allows |
11 | * cleaner use of such functions by proper use of ``const''. |
11 | * cleaner use of such functions by proper use of ``const''. |
12 | * |
12 | * |
13 | * $Id: fptools.h,v 1.10 2020/02/14 08:02:26 root Exp $ |
13 | * $Id: fptools.h,v 1.11 2020/02/27 06:14:29 root Exp $ |
14 | */ |
14 | */ |
15 | |
15 | |
16 | #ifndef FPTOOLS_H__ |
16 | #ifndef FPTOOLS_H__ |
17 | #define FPTOOLS_H__ |
17 | #define FPTOOLS_H__ |
18 | |
18 | |
19 | #include <string.h> |
19 | #include <string.h> |
20 | |
20 | |
21 | typedef signed char schar; |
21 | typedef signed char schar; |
22 | typedef unsigned char uchar; |
22 | typedef unsigned char uchar; |
23 | |
23 | |
|
|
24 | #include "ecb.h" |
|
|
25 | |
24 | #ifndef TOOLEXPORT |
26 | #ifndef TOOLEXPORT |
25 | #define TOOLEXPORT |
27 | #define TOOLEXPORT |
26 | #endif |
28 | #endif |
27 | |
29 | |
28 | #ifdef __cplusplus |
30 | #ifdef __cplusplus |
29 | extern "C" { |
31 | extern "C" { |
30 | #endif |
|
|
31 | |
|
|
32 | /* relicensed from libecb with permission */ |
|
|
33 | #if 1 |
|
|
34 | |
|
|
35 | #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
|
|
36 | |
|
|
37 | #if ECB_GCC_VERSION(3,1) |
|
|
38 | #define ecb_expect(expr,value) __builtin_expect ((expr),(value)) |
|
|
39 | #else |
|
|
40 | #define ecb_expect(expr,value) (expr) |
|
|
41 | #endif |
|
|
42 | |
|
|
43 | #define ecb_expect_false(expr) ecb_expect (!!(expr), 0) |
|
|
44 | #define ecb_expect_true(expr) ecb_expect (!!(expr), 1) |
|
|
45 | |
|
|
46 | #endif |
32 | #endif |
47 | |
33 | |
48 | #define _FP_free FP_free |
34 | #define _FP_free FP_free |
49 | #define _FP_strdup FP_strdup |
35 | #define _FP_strdup FP_strdup |
50 | #define _FP_strncpy FP_strncpy |
36 | #define _FP_strncpy FP_strncpy |