]> gitweb.factorcode.org Git - factor.git/blob - vm/utilities.hpp
vm: fix compile error on non-Mac OS X platforms
[factor.git] / vm / utilities.hpp
1 namespace factor
2 {
3
4 inline static void memset_cell(void *dst, cell pattern, size_t size)
5 {
6 #ifdef __APPLE__
7         #ifdef FACTOR_64
8                 memset_pattern8(dst,&pattern,size);
9         #else
10                 memset_pattern4(dst,&pattern,size);
11         #endif
12 #else
13         if(pattern == 0)
14                 memset(dst,0,size);
15         else
16         {
17                 cell *start = (cell *)dst;
18                 cell *end = (cell *)((cell)dst + size);
19                 while(start < end)
20                 {
21                         *start = pattern;
22                         start++;
23                 }
24         }
25 #endif
26 }
27
28 vm_char *safe_strdup(const vm_char *str);
29 void print_string(const char *str);
30 void nl();
31 void print_cell(cell x);
32 void print_cell_hex(cell x);
33 void print_cell_hex_pad(cell x);
34 void print_fixnum(fixnum x);
35 cell read_cell_hex();
36
37 }