Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
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
31extern "C" {
32
33typedef int __stdcall pfiipv_t (int*);
34typedef int __stdcall pfiip_t (volatile int*);
35typedef long __stdcall pfllp_t (long*);
36typedef long __stdcall pfllpv_t (volatile long*);
37
38} // extern "C"
39
40
41const char* foo (pfiip_t) { return "int"; }
42const char* foo (pfiipv_t) { return "volatile int"; }
43
44const char* foo (pfllp_t) { return "long"; }
45const char* foo (pfllpv_t) { return "volatile long"; }
46
47
48int 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
63int main ()
64{
65 return 0;
66}
67
68#endif // Windows
int main()
IMPORT_C SInt32 printf(const Char *,...)
#define foo(buf, s,...)