[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
mingw patch for mkdir()
From: |
wrotycz |
Subject: |
mingw patch for mkdir() |
Date: |
Mon, 05 Feb 2024 00:59:31 +0100 |
User-agent: |
GWP-Draft |
In (c)lzip definition of mkdir takes 2 arguments while in windows it takes 1, which causes compilation error.
```
gcc -Wall -W -O2 -DPROGVERSION=\"1.14\" -c -o main.o main.c
main.c: In function 'make_dirs':
main.c:527:16: error: too many arguments to function 'mkdir'
527 | else if( mkdir( partial, mode ) != 0 && errno != EEXIST )
| ^~~~~
```
It can be solved by defining macro in "windows" section.
```
diff clzip-1.14/main.c clzip-1.14-mkdir/main.c
43a44
> #define mkdir(x,y) mkdir(x)
```
Same for lzip.
```
diff lzip-1.24/main.cc lzip-1.24-mkdir/main.cc
46a47
> #define mkdir(x,y) mkdir(x)
```
Same for plzip but didn't check it yet.
It's no lzip as it would require static link of whole libstdc++ which is unnecessary as C version is just as fast.
Speaking of speed decoder seems to be faster when compiled with `-O3' optimization. Also decoder is faster compiled with GCC and encoder compiled with Clang.
- mingw patch for mkdir(),
wrotycz <=