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
ATOMIC_OPS.cpp
Go to the documentation of this file.
1
// checking for atomic operations
2
3
25
#if defined (_WIN32) && !defined (_WIN64)
26
27
#include <
stdio.h
>
28
#include <windows.h>
29
30
31
extern
"C"
{
32
33
typedef
int
__stdcall pfiipv_t (
int
*);
34
typedef
int
__stdcall pfiip_t (
volatile
int
*);
35
typedef
long
__stdcall pfllp_t (
long
*);
36
typedef
long
__stdcall pfllpv_t (
volatile
long
*);
37
38
}
// extern "C"
39
40
41
const
char
*
foo
(pfiip_t) {
return
"int"
; }
42
const
char
*
foo
(pfiipv_t) {
return
"volatile int"
; }
43
44
const
char
*
foo
(pfllp_t) {
return
"long"
; }
45
const
char
*
foo
(pfllpv_t) {
return
"volatile long"
; }
46
47
48
int
main
()
49
{
50
// determine the argument type of InterlockedIncrement()
51
// (the type changes from long* to volatile long* depending
52
// on the version/patch of MSVC)
53
54
printf
(
"#define _RWSTD_INTERLOCKED_T %s\n"
,
foo
(InterlockedIncrement));
55
56
return
0;
57
}
58
59
#else
// not 32-bit Windows
60
61
#include <
stdio.h
>
62
63
int
main
()
64
{
65
return
0;
66
}
67
68
#endif
// Windows
main
int main()
Definition
ATOMIC_OPS.cpp:63
printf
IMPORT_C SInt32 printf(const Char *,...)
foo
#define foo(buf, s,...)
Definition
VA_LIST_FUNC_MACRO.cpp:28
foo
Definition
VARIADIC_TEMPLATES.cpp:25
stdio.h
Generated by
1.9.8