RE: [boost] [shared_ptr] InterlockedIncrement rocks!

Also, why not including windows.h directly, like this: #define WIN32_LEAN_AND_MEAN #include <windows.h>
I believe WIN32_EXTRA_LEAN may be even better.
<side-note> From my tests it seems your version as is now fails to link for gcc (unresolved external _InterlockedIncrement/_InterlockedDecrement). However, if #including <windows.h> and use InterlockedIncrement/Decrement - they work. </side-note>
That is not suprising - Interlocked* are parts of the Win32 API. In fact, it has been a complete mistery to me as to why boost doesn't use atomic operations for its ref counting. The mutex on the counter was one of the big reasons why people here decided not to use shared_ptr. Tom -------------------------------------------------------- NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.

Puverle, Tomas (IT) wrote:
Also, why not including windows.h directly, like this: #define WIN32_LEAN_AND_MEAN #include <windows.h>
I believe WIN32_EXTRA_LEAN may be even better.
Just a thought - there is no WIN32_EXTRA_LEAN on vc7.1 Best, John -- John Torjo -- john@torjo.com Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.4 - save_dlg - true binding of your data to UI controls! + easily add validation rules (win32gui/examples/smart_dlg)
participants (2)
-
John Torjo
-
Puverle, Tomas (IT)