Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

A small bug

ksgokul
Beginner
405 Views
Hi,
I was trying to write a program, where i am using both Intel TBB and ACE(Adaptive Communication Environment). I came across an error, where lot of definitions in winsock.h have found its duplicate in winsock2.h.
Intel TBB includes windows.h in my machine and thereby it includes winsock.h, whereas ACE includes winsock2.h. The only solution, i could find in net is to declare winsock2.h before windows.h.
So i made the change in windows_ia32.h and windows_em64.h(both under tbb/machine), to include winsock2.h before windows.h and the errors were stopped. I think this might be a useful change to incorporate. Since TBB is not concerned with socket calls and winsock2.h is a more advanced version than winsock.h, i think this is a change, which won't cause any harm.

Thanks,
Gokul.
0 Kudos
3 Replies
michaelmarcin
Beginner
405 Views
I believe defining WIN32_LEAN_AND_MEAN would also have solved your problem. IIRC it prevents windows.h from including winsock.h.
0 Kudos
Dmitry_Vyukov
Valued Contributor I
405 Views
I think you can just include before any TBB headers. Or include ACE headers before TBB headers.

0 Kudos
ksgokul
Beginner
405 Views
Thanks. The #define WIN32_LEAN_AND_MEAN solved my problem without the need to touch TBB source.

Thanks,
Gokul.
0 Kudos
Reply