vxx2 / vlib / builtin / cfns_windows_tcc.h
15 lines · 15 sloc · 758 bytes · beca086a88005cf571aa90172e666a8cd64a1536
Raw
1// TCC's bundled <windows.h> does not include <fileapi.h>, and TCC's own
2// <fileapi.h> cannot be used either because it pulls in <apiset.h>, a header
3// TCC does not ship. As a result GetFinalPathNameByHandleW has no declaration
4// in scope when TCC compiles code that uses it (e.g. os.real_path).
5//
6// Provide the declaration for TCC only. GCC/MSVC get it from the Windows SDK
7// (via <windows.h> -> <fileapi.h>); emitting a V-side extern there would
8// conflict with the SDK's `DWORD WINAPI` signature, since DWORD is
9// `unsigned long`, not `unsigned int`.
10#ifdef __TINYC__
11#ifndef GetFinalPathNameByHandleW
12extern unsigned int GetFinalPathNameByHandleW(void *hFile, unsigned short *lpFilePath,
13 unsigned int nSize, unsigned int dwFlags);
14#endif
15#endif
16