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

Clang has __popcnt for ARM #112

Merged
merged 1 commit into from
Mar 5, 2023
Merged

Clang has __popcnt for ARM #112

merged 1 commit into from
Mar 5, 2023

Conversation

zcbenz
Copy link
Contributor

@zcbenz zcbenz commented Mar 3, 2023

When building on Windows with clang for ARM targets, __popcnt is defined.

When binding on Windows with clang for ARM targets, `__popcnt` is defined.
zcbenz added a commit to zcbenz/node that referenced this pull request Mar 3, 2023
zcbenz added a commit to zcbenz/node that referenced this pull request Mar 3, 2023
zcbenz added a commit to zcbenz/node that referenced this pull request Mar 3, 2023
zcbenz added a commit to zcbenz/node that referenced this pull request Mar 3, 2023
zcbenz added a commit to zcbenz/node that referenced this pull request Mar 4, 2023
@Keitagit-kun
Copy link

I'm building on Windows with mingw-w64 x86_64-7.2.0 for windows and __popcnt is also missing. So, maybe cover all cases like that:

#if !defined __popcnt
	static unsigned int __popcnt(unsigned int x) {
	  unsigned int c = 0;
	  for (; x; ++c) {
		x &= x - 1;
	  }
	  return c;
	}
#endif

"static" - so it wont interfere with ngtcp2...

@tatsuhiro-t
Copy link
Member

It would be nice to add function detection to configure and cmake scripts to handle this generally.

@tatsuhiro-t tatsuhiro-t merged commit 439e5c4 into ngtcp2:main Mar 5, 2023
@tatsuhiro-t
Copy link
Member

Thank you for PR. Merged now.

@tatsuhiro-t tatsuhiro-t modified the milestones: v0.9.0, v0.10.0 Mar 5, 2023
zcbenz added a commit to zcbenz/node that referenced this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants