Florian Ragwitz pushed to branch wip/rafl/hpc-tixdir at Glasgow Haskell Compiler / GHC
Commits:
-
673b0008
by Florian Ragwitz at 2026-10-19T14:07:05-07:00
1 changed file:
Changes:
| ... | ... | @@ -460,8 +460,13 @@ static void output_name(char *buf, size_t cap, size_t group) { |
| 460 | 460 | if (snprintf(buf, cap, "merged-%04zu.tix", group + 1) >= (int)cap)
|
| 461 | 461 | die("too many output groups");
|
| 462 | 462 | }
|
| 463 | +#ifndef _WIN32
|
|
| 464 | +# define MKDIR(p) mkdir((p), 0777)
|
|
| 465 | +#else
|
|
| 466 | +# define MKDIR(p) mkdir((p))
|
|
| 467 | +#endif
|
|
| 463 | 468 | static void ensure_empty_output_dir(const char *in, const char *out) {
|
| 464 | - if (mkdir(out, 0777) && errno != EEXIST) { perror(out); exit(1); }
|
|
| 469 | + if (MKDIR(out, 0777) && errno != EEXIST) { perror(out); exit(1); }
|
|
| 465 | 470 | struct stat a, b;
|
| 466 | 471 | if (stat(in, &a) || stat(out, &b) || !S_ISDIR(b.st_mode))
|
| 467 | 472 | die("invalid input/output directory");
|