Advertisement
Ai4rei

test.cpp

Jan 24th, 2017
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. // CL /nologo /W3 /Zs test.cpp
  2. // VC 6
  3. // -- OK
  4. // VC 2010 Express
  5. // -- test.cpp(30) : error C2563: mismatch in formal parameter list
  6. // -- test.cpp(30) : error C2568: ':' : unable to resolve function overload
  7. // -- can be worked around with MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS = 0
  8.  
  9. // CL /nologo /W3 /Zs test.cpp
  10.  
  11. #include <windows.h>
  12.  
  13. void DispA(LONG* lplVal)
  14. {
  15. }
  16.  
  17. void DispB(LONG* lplVal)
  18. {
  19. }
  20.  
  21. void main()
  22. {
  23.     BOOL bLock = FALSE;
  24.     LONG lLocks = 0L;
  25.     ULONG ulLocks = 0UL;
  26.  
  27.     (bLock ? DispA : DispB)(&lLocks);
  28.     (bLock ? DispA : DispB)((LPLONG)&ulLocks);
  29.  
  30.     (bLock ? InterlockedIncrement : InterlockedDecrement)(&lLocks);
  31.     (bLock ? InterlockedIncrement : InterlockedDecrement)((LPLONG)&ulLocks);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement