Cyan4973 / Cyan4973/xxHash

XXH_INLINE_ALL conflict with xxh_x86dispatch

Closed
#1,071 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
11.2k
Forks
913
Avg merge
2h 57m
Merged PRs (30d)
17

Description

By defining XXH_INLINE_ALL, I have compilation error on MSVS.

Blaming: xxh_x86dispatch.h::XXH3_128bits_dispatch
Error text: static function declared but not defined.

My code is:
```
#define XXH_INLINE_ALL
#include "xxh_x86dispatch.h"

static inline std::vector xxh128(const std::vector& data)
{
const XXH128_hash_t hash = XXH3_128bits(data.data(), data.size());
// ...
}
```

Included files:
```
xxh_x86dispatch.h
xxh_x86dispatch.c
xxhash.h
```

Uses the latest source code of "dev" branch.
Removing XXH_INLINE_ALL fixes the issue.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the inclusion pattern shown in xxh_x86dispatch.h, xxh_x86dispatch.c, and xxhash.h, defining XXH_INLINE_ALL and compiling with MSVS. Compare that build with the version where XXH_INLINE_ALL is removed, then verify that XXH3_128bits_dispatch is both declared and defined without the static-function error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.