Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
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
30
extern
"C"
{
31
32
typedef
int (
f_i_vpui
)(
void
*, size_t);
33
typedef
int (
f_i_cpui
)(
char
*, size_t);
34
35
}
36
37
38
const
char
*
munmap_arg2_type_imp
(
f_i_vpui
*) {
return
"void*"
; }
39
const
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*
43
const
char
*
get_munmap_arg2_type
()
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
54
int
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
}
printf
IMPORT_C SInt32 printf(const Char *,...)
get_munmap_arg2_type
const char * get_munmap_arg2_type()
Definition
MUNMAP.cpp:43
f_i_vpui
int() f_i_vpui(void *, size_t)
Definition
MUNMAP.cpp:32
f_i_cpui
int() f_i_cpui(char *, size_t)
Definition
MUNMAP.cpp:33
main
int main()
Definition
MUNMAP.cpp:54
munmap_arg2_type_imp
const char * munmap_arg2_type_imp(f_i_vpui *)
Definition
MUNMAP.cpp:38
stdio.h
Generated by
1.9.8