Merge: doc: fixed some typos and other misc. corrections
[nit.git] / c_src / core__native._ffi.c
1 /*
2 Extern implementation of Nit module native
3 */
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <stdint.h>
7 #include "core__native._ffi.h"
8 #ifdef ANDROID
9 #include <android/log.h>
10 #define PRINT_ERROR(...) (void)__android_log_print(ANDROID_LOG_WARN, "Nit", __VA_ARGS__)
11 #else
12 #define PRINT_ERROR(...) fprintf(stderr, __VA_ARGS__)
13 #endif
14 #line 17 "../lib/core/text/native.nit"
15
16
17 #ifdef __linux__
18 #include <endian.h>
19 #endif
20 #ifdef __APPLE__
21 #include <libkern/OSByteOrder.h>
22 #define be32toh(x) OSSwapBigToHostInt32(x)
23 #endif
24 #ifdef _WIN32
25 #define be32toh(val) _byteswap_ulong(val)
26 #endif
27
28 #ifdef __pnacl__
29 #define be16toh(val) (((val) >> 8) | ((val) << 8))
30 #define be32toh(val) ((be16toh((val) << 16) | (be16toh((val) >> 16))))
31 #endif
32 #ifndef be32toh
33 #define be32toh(val) betoh32(val)
34 #endif
35 double core__native___CString_atof___impl( char* self )
36 {
37 #line 131 "../lib/core/text/native.nit"
38
39 return atof(self); }
40 uint32_t core__native___UInt32_code_point___impl( uint32_t self )
41 {
42 #line 90 "../lib/core/text/native.nit"
43
44 return self; }