Now my implement successful run on Windows on these effect:
For example:
This will print “2”.
Now I add “<Python.h>”. On windows, the “pyconfig.h” will define it:
Then you can see the value of “HAVE_FTIME”:
![]()
Yes. It is not 2.
Then, I add the macro “Py_OMIT_LEGACY_API”:
It recoveries to 2:

Then, I undefine the macro “HAVE_FTIME”:
VScode error that “HAVE_FTIME” is not defined:
Now the question is here:
How to define it to ensure that when the macros expand.
The biggest question is that this macro doesn’t warning when be expanded: it error. The other problems can be solved easily.
Now the defination is:
#if defined(__clang__) || defined(__GNUC__)
#define _PY_WARN_MACRO(msg) _Pragma("GCC warning \"" msg "\"")
#elif defined(_MSC_VER)
#define _PY_WARN_MACRO(msg) __pragma(message("warning: " msg))
#else
#define _PY_WARN_MACRO(msg)
#endif
Is there a better way to make it?




