Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CL /nologo /W3 /Zs test.cpp
- // VC 6
- // -- OK
- // VC 2010 Express
- // -- test.cpp(30) : error C2563: mismatch in formal parameter list
- // -- test.cpp(30) : error C2568: ':' : unable to resolve function overload
- // -- can be worked around with MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS = 0
- // CL /nologo /W3 /Zs test.cpp
- #include <windows.h>
- void DispA(LONG* lplVal)
- {
- }
- void DispB(LONG* lplVal)
- {
- }
- void main()
- {
- BOOL bLock = FALSE;
- LONG lLocks = 0L;
- ULONG ulLocks = 0UL;
- (bLock ? DispA : DispB)(&lLocks);
- (bLock ? DispA : DispB)((LPLONG)&ulLocks);
- (bLock ? InterlockedIncrement : InterlockedDecrement)(&lLocks);
- (bLock ? InterlockedIncrement : InterlockedDecrement)((LPLONG)&ulLocks);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement