根据once pragma:
The use of
#pragma once
can reduce build times, as the compiler won't open and read the file again after the first#include
of the file in the translation unit.
所以如果你的宏定义在有errno
定义的头文件和xlocnum
之间的话,会覆盖之后的errno
宏定义即使xlocnum
也已经include那些头文件.
#include <Windows.h>
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#ifdef errno
#undef errno
#endif
#define errno GetLastError()
#include <xlocnum>