asn1: Add a GitHub Markdown manual
[heimdal.git] / include / krb5-types.cross
blob4dc5c6aa8f5dcb1c3bcf6b5b8914a006f3964a84
1 /*
2  * generic krb5-types.h for cross compiling, assume system is posix/sus
3  */
5 #ifndef __krb5_types_h__
6 #define __krb5_types_h__
8 #include <inttypes.h>
9 #include <sys/types.h>
10 #include <sys/socket.h>
12 typedef socklen_t krb5_socklen_t;
13 #include <unistd.h>
14 typedef ssize_t krb5_ssize_t;
16 #if !defined(__has_extension)
17 #define __has_extension(x) 0
18 #endif
20 #define KRB5TYPES_REQUIRE_GNUC(m,n,p) \
21     (((__GNUC__ * 10000) + (__GNUC_MINOR__ * 100) + __GNUC_PATCHLEVEL__) >= \
22      (((m) * 10000) + ((n) * 100) + (p)))
25 #ifndef HEIMDAL_DEPRECATED
26 #if __has_extension(deprecated) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
27 #define HEIMDAL_DEPRECATED __attribute__ ((__deprecated__))
28 #elif defined(_MSC_VER) && (_MSC_VER>1200) 
29 #define HEIMDAL_DEPRECATED __declspec(deprecated)
30 #else
31 #define HEIMDAL_DEPRECATED
32 #endif
33 #endif
35 #ifndef HEIMDAL_PRINTF_ATTRIBUTE
36 #if __has_extension(format) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
37 #define HEIMDAL_PRINTF_ATTRIBUTE(x) __attribute__ ((__format__ x))
38 #else
39 #define HEIMDAL_PRINTF_ATTRIBUTE(x)
40 #endif
41 #endif
43 #ifndef HEIMDAL_NORETURN_ATTRIBUTE
44 #if __has_extension(noreturn) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
45 #define HEIMDAL_NORETURN_ATTRIBUTE __attribute__ ((__noreturn__))
46 #else
47 #define HEIMDAL_NORETURN_ATTRIBUTE
48 #endif
49 #endif
51 #ifndef HEIMDAL_UNUSED_ATTRIBUTE
52 #if __has_extension(unused) || KRB5TYPES_REQUIRE_GNUC(3,1,0)
53 #define HEIMDAL_UNUSED_ATTRIBUTE __attribute__ ((__unused__))
54 #else
55 #define HEIMDAL_UNUSED_ATTRIBUTE
56 #endif
57 #endif
59 #ifndef HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE
60 #if __has_extension(__warn_unused_result__) || KRB5TYPES_REQUIRE_GNUC(3,3,0)
61 #define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE __attribute__ ((__warn_unused_result__))
62 #endif
63 #endif
65 typedef int krb5_socket_t;
67 #endif /* __krb5_types_h__ */