Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW64 memset fix #115

Merged
merged 2 commits into from
Jan 14, 2024
Merged

MinGW64 memset fix #115

merged 2 commits into from
Jan 14, 2024

Conversation

kadir014
Copy link
Contributor

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
Copy link
Owner

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).,

@dougbinks dougbinks self-requested a review January 14, 2024 11:10
@dougbinks dougbinks self-assigned this Jan 14, 2024
Instead of including `<cstring>` and `<string.h>` separately, include `<string.h>` on all platforms.
@kadir014
Copy link
Contributor Author

Thanks for the heads up. Done!

@dougbinks dougbinks merged commit f90164c into dougbinks:master Jan 14, 2024
3 of 4 checks passed
@dougbinks
Copy link
Owner

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants