#define OUTPUT_FILE "configurator.out"
#define INPUT_FILE "configuratortest.c"
+#ifdef _WIN32
+#define DIR_SEP "\\"
+#else
+#define DIR_SEP "/"
+#endif
+
static int verbose;
enum test_style {
" setcontext(&b);\n"
" x |= 4;\n"
"}\n"
- "int main(int argc, char *argv[]) {\n"
+ "int main(void) {\n"
" x |= 1;\n"
" getcontext(&a);\n"
" a.uc_stack.ss_sp = stack;\n"
" worked = 1;\n"
" setcontext(&b);\n"
"}\n"
- "int main(int argc, char *argv[]) {\n"
+ "int main(void) {\n"
" void *ap = &worked;\n"
" void *aq = (void *)(~((ptrdiff_t)ap));\n"
" getcontext(&a);\n"
free(output);
/* We run INSIDE_MAIN tests for sanity checking. */
if ((test->style & EXECUTE) || (test->style & INSIDE_MAIN)) {
- output = run("./" OUTPUT_FILE, &status);
+ output = run("." DIR_SEP OUTPUT_FILE, &status);
if (!(test->style & EXECUTE) && status != 0)
errx(1, "Test for %s failed with %i:\n%s",
test->name, status, output);
run_test(cmd, &tests[i]);
free(cmd);
- unlink(OUTPUT_FILE);
- unlink(INPUT_FILE);
+ remove(OUTPUT_FILE);
+ remove(INPUT_FILE);
printf("/* Generated by CCAN configurator */\n"
"#ifndef CCAN_CONFIG_H\n"