NOTICE: Update author list and years
[nit.git] / c_src / core__kernel._ffi.c
1 /*
2 Extern implementation of Nit module kernel
3 */
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <stdint.h>
7 #include "core__kernel._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 22 "../lib/core/kernel.nit"
15
16
17 #include <stdlib.h>
18 #include <errno.h>
19 long kernel___Sys_errno___impl( Sys self )
20 {
21 #line 298 "../lib/core/kernel.nit"
22
23 return errno; }
24 unsigned char kernel___Byte_rsh___impl( unsigned char self, long i )
25 {
26 #line 655 "../lib/core/kernel.nit"
27
28 return self >> i; }
29 uint32_t kernel___Byte_ffi_ascii___impl( unsigned char self )
30 {
31 #line 662 "../lib/core/kernel.nit"
32
33 return (uint32_t)self; }
34 long kernel___Int_lsh___impl( long self, long i )
35 {
36 #line 753 "../lib/core/kernel.nit"
37
38 return self << i; }
39 long kernel___Int_rsh___impl( long self, long i )
40 {
41 #line 760 "../lib/core/kernel.nit"
42
43 return self >> i; }
44 uint32_t kernel___Int_cp___impl( long self )
45 {
46 #line 821 "../lib/core/kernel.nit"
47
48 return (uint32_t)self; }
49 long kernel___Char_cp___impl( uint32_t self )
50 {
51 #line 969 "../lib/core/kernel.nit"
52
53 return (long)self; }
54 int kernel___Pointer_address_is_null___impl( void* self )
55 {
56 #line 1070 "../lib/core/kernel.nit"
57
58 return self == NULL; }
59 void kernel___Pointer_free___impl( void* self )
60 {
61 #line 1073 "../lib/core/kernel.nit"
62
63 free(self); }