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

Windows build failing due to missing include header #81

Closed
choikwa opened this issue Jun 6, 2016 · 1 comment · Fixed by #86
Closed

Windows build failing due to missing include header #81

choikwa opened this issue Jun 6, 2016 · 1 comment · Fixed by #86

Comments

@choikwa
Copy link

choikwa commented Jun 6, 2016

Build on MSVC fails due to missing decl for memcpy. Line 94 at src/wasm-config.h.in,

#elif COMPILER_IS_MSVC

#define WASM_UNUSED
#define WASM_WARN_UNUSED _Check_return_
#define WASM_INLINE __inline
#define WASM_STATIC_ASSERT(x) _STATIC_ASSERT(x)
#define WASM_UNLIKELY(x) (x)
#define WASM_LIKELY(x) (x)
#define WASM_PRINTF_FORMAT(format_arg, first_arg)

__inline unsigned long wasm_clz_u32(unsigned long mask) {
  unsigned long index;
  _BitScanReverse(&index, mask);
  return sizeof(unsigned long) * 8 - (index + 1);
}

__inline unsigned long wasm_clz_u64(unsigned __int64 mask) {
#if _M_X64
  unsigned long index;
  _BitScanReverse64(&index, mask);
  return sizeof(unsigned __int64) * 8 - (index + 1);
#elif _M_IX86
  unsigned long index;
  unsigned long high_mask;
  memcpy(&high_mask, (unsigned char*)&mask + sizeof(unsigned long),
         sizeof(unsigned long));
  if (_BitScanReverse(&index, high_mask)) {
    return sizeof(unsigned long) * 8 - (index + 1);
  }

  unsigned long low_mask;
  memcpy(&low_mask, &mask, sizeof(unsigned long));
  _BitScanReverse(&index, low_mask);
  return sizeof(unsigned __int64) * 8 - (index + 1);
#else
#error unexpected architecture
#endif
}

Issue is fixed by include <string.h>

@Cellule
Copy link
Contributor

Cellule commented Jun 7, 2016

I am aware of this issue and am working on various fixes for Windows

This was referenced Jun 7, 2016
@binji binji closed this as completed in #86 Jun 17, 2016
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 a pull request may close this issue.

2 participants