RE: Glade 0.5.6 under Cygwin/NT4.0



>> ctype.h and direct.h do not contain the definition of "mkdir" and "DIR".
>> The definition of "mkdir" is in mingw32/dir.h and "DIR" is in
>> mingw32/dirent.h.

>The problem is that these defines have only been used/tested with MSVC, not
>GCC 2.92.2 (this is the next plan).

Right! meantime here is a fix:

#ifdef _WIN32
# ifdef __CYGWIN32__
#  include <unistd.h>
#  include <sys/dirent.h>
# else  /* __CYGWIN32__ */
#  include <ctype.h>
#  include <direct.h>
# endif /* __CYGWIN32__ */
#else
#include <unistd.h>
#include <dirent.h>
#endif

....

#ifdef _WIN32
# ifdef __CYGWIN32__
	  if (mkdir (directory, 0777) != 0)
# else  /* __CYGWIN32__ */
	  if (mkdir (directory) != 0)
# endif /* __CYGWIN32__ */
#else
	  if (mkdir (directory, 0777) != 0)
#endif

Now the code compiles. Let's see if everything is working with directories
...

Jorge



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]