Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
MUNMAP.cpp
Go to the documentation of this file.
1// checking for munmap() in <sys/mman.h>
2
3
25// include <sys/types.h> first in case mman.h depends
26// on it (such as the one on Darwin -- see STDCXX-107)
27#include <sys/types.h> // for size_t
28#include <sys/mman.h> // for munmap()
29
30extern "C" {
31
32typedef int (f_i_vpui)(void*, size_t);
33typedef int (f_i_cpui)(char*, size_t);
34
35}
36
37
38const char* munmap_arg2_type_imp (f_i_vpui*) { return "void*"; }
39const char* munmap_arg2_type_imp (f_i_cpui*) { return "char*"; }
40
41// determine whether the type of the second argument
42// to munmap() is void* or char*
44{
45 return munmap_arg2_type_imp (&munmap);
46}
47
48
49// include last so as not to pollute the global namespace
50// and skew the result of the test
51#include <stdio.h>
52
53
54int main ()
55{
56 const char *argtype = get_munmap_arg2_type ();
57
58 printf ("#define _RWSTD_MUNMAP_ARG1_T %s\n", argtype);
59
60 return 0;
61}
IMPORT_C SInt32 printf(const Char *,...)
const char * get_munmap_arg2_type()
Definition MUNMAP.cpp:43
int() f_i_vpui(void *, size_t)
Definition MUNMAP.cpp:32
int() f_i_cpui(char *, size_t)
Definition MUNMAP.cpp:33
int main()
Definition MUNMAP.cpp:54
const char * munmap_arg2_type_imp(f_i_vpui *)
Definition MUNMAP.cpp:38