Hi Lu, mkdir is provided, but takes only 1 parameter - at least on the
latest version of MingW, the one I use.

    src/util/path.cc:30:40: error: too many arguments to function 'int
mkdir(const char*)'
         int r = mkdir(path.c_str(), S_IRWXU);
                                        ^
    In file included from src/util/win32.h:13:0,
                     from src/util/path.cc:14:
    d:\apps\mingw\include\io.h:311:37: note: declared here
     _CRTIMP int __cdecl __MINGW_NOTHROW mkdir (const char*);

That is why I use a define. Defining to _mkdir or mkdir works either way.

For "struct stat", it seems it is not defined when compiling PDF2HTML,
probably due to:

    sys/stat..h
    #ifndef __STRICT_ANSI__
    struct stat {
    ...

Before committing the code, I tried compiling it without changes and also
searched for the functions in the MingW headers but couldn't find them,
thus the defines.




On Tue, Jan 14, 2014 at 12:06 AM, Lu Wang <notifications@github.com> wrote:

> In src/util/win32.h:
>
> > + * by MarcSanfacon
> > + * 2014.01.13
> > + */
> > +
> > +#ifndef WIN32_H__
> > +#define WIN32_H__
> > +
> > +#ifdef _WIN32
> > +
> > +#include <io.h>
> > +#include <libgen.h>
> > +#include <sstream>
> > +
> > +char *mkdtemp(char *temp);
> > +
> > +#define mkdir(A, B) _mkdir(A)
>
> I just downloaded and tried mingw, mkdir and stat are provided
>
> #include <iostream>#include <unistd.h>#include <sys/stat.h>
> using namespace std;
> int main() {
>   struct stat st;
>   cout << &mkdir << endl;
>   return 0;}
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/coolwanglu/pdf2htmlEX/pull/285/files#r8850787>
> .
>