port: add MSVC600 CPython compatibility layer
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/* Focused, isolated compile smoke test for compat/msvc600/stdbool.h under
|
||||
* VC6.
|
||||
*
|
||||
* Deliberately does NOT go through pycore_interp.h or any other pycore_*.h
|
||||
* header: this isolates the result to the <stdbool.h> shim itself, the
|
||||
* same way scripts/fixtures/vc6_atomic_smoke.c isolates pycore_atomic.h.
|
||||
* Modules/main.c (see scripts/vc6-probe-core.test.sh) is the real-header
|
||||
* reference case that proves compat/msvc600/stdbool.h is actually what
|
||||
* pycore_interp.h's `#include <stdbool.h>` resolves to via the VC6 probe
|
||||
* scripts' include path.
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
|
||||
static bool vc6_stdbool_flag = true;
|
||||
|
||||
int
|
||||
vc6_stdbool_smoke(void)
|
||||
{
|
||||
bool a = true;
|
||||
bool b = false;
|
||||
bool c = a && !b;
|
||||
|
||||
vc6_stdbool_flag = c;
|
||||
|
||||
if (!__bool_true_false_are_defined) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (int)(a == true) + (int)(b == false) + (int)(c == true)
|
||||
+ (int)vc6_stdbool_flag;
|
||||
}
|
||||
Reference in New Issue
Block a user