我有一个广泛使用pthread.h的代码库.在windows visual studio项目中,这显然不起作用,因为pthreads是一个unix实用程序.
我知道存在pthread-win32或类似的东西,但有没有办法让代码库使用它,而不替换所有的pthread代码?
编辑:我宁愿不必通过并替换所有的pthread调用.这是我的问题
I would recommend boost as a library that contains a platform-independent thread abstraction. I don't think you'll find any attempt to call the pthread functions themselves to be satisfying. It's also not very hard to map pthread to Win32 for yourself.