moved the MKDIR macro to util.h

This commit is contained in:
Andrei "Akari" Alexeyev 2017-03-20 07:35:59 +02:00
parent ceb5f6b16b
commit 5d1eb2bd68
2 changed files with 6 additions and 6 deletions

View file

@ -83,12 +83,6 @@ int run_tests(void) {
return 0;
}
#ifndef __POSIX__
#define MKDIR(p) mkdir(p)
#else
#define MKDIR(p) mkdir(p, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
#endif
int main(int argc, char **argv) {
setlocale(LC_ALL, "C");

View file

@ -128,6 +128,12 @@ noreturn void _ts_assert_fail(const char *cond, const char *func, const char *fi
#define assert(cond) _assert(cond, true)
#define assert_nolog(cond) _assert(cond, false)
#ifndef __POSIX__
#define MKDIR(p) mkdir(p)
#else
#define MKDIR(p) mkdir(p, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
#endif
//
// safeguards against some dangerous or otherwise undesirable practices
//