dougbinks / enkiTS

A permissively licensed C and C++ Task Scheduler for creating parallel programs. Requires C++11 support.
zlib License
1.66k stars 138 forks source link

MinGW64 `memset` fix #115

Closed kadir014 closed 6 months ago

kadir014 commented 6 months ago

When I tried to build enkiTS on Windows10 with MinGW64 (GCC13) example demos raised this error:

C:\Users\User\Desktop\enkiTS\example\ParallelSum.cpp:60:9: error: 'memset' was not declared in this scope
   60 |         memset( m_pPartialSums, 0, sizeof(Count)*m_NumPartialSums );
      |         ^~~~~~

This PR fixes them.

dougbinks commented 6 months ago

Many thanks for spotting this and for the PR.

I think a simpler fix for this would be to change:


#ifndef _WIN32
    #include <string.h>
#endif

to

#include <string.h>

As memset is defined in string.h on Windows platforms as well (just also pulled in by other headers). This would also make the source code slightly easier to read. Whilst I could do this after merging your PR, if you do it then it would keep the timeline slightly cleaner (I'd like to make sure your authorship is kept as part of the commit record).,

kadir014 commented 6 months ago

Thanks for the heads up. Done!

dougbinks commented 6 months ago

Many thanks!