Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
winnt.h: FORCELINLINE inline-only definitions
The following test application fails to build on i686 when building without optimization: $ cat foo.c #include <windows.h> int main () { MEMORY_BASIC_INFORMATION m; NT_TIB *tib = (NT_TIB *) NtCurrentTeb (); VirtualQuery (tib, &m, sizeof m); } $ gcc -g -O foo.c -o foo $ gcc -g foo.c -o foo /tmp/ccnnAEl3.o: In function `main': /home/corinna/foo.c:7: undefined reference to `NtCurrentTeb' collect2: error: ld returned 1 exit status There's no way around that, except for building with optimization, which is often not prudent when debugging. In winnt.h, NtCurrentTeb is using __CRT_INLINE which, depending on C standard, expandes into extern inline __attribute__((__gnu_inline__)) or extern __inline__ However, that's not sufficient for NtCurrentTeb, nor for GetCurrentFiber, nor for GetFiberData, since these are inline-only functions not backed by non-inlined library versions. This patch fixes that by using FORCEINLINE in place of __CRT_INLINE. Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
- Loading branch information