djgpp: Fixed compiler warnings/errors when compiling with DJGPP

This commit is contained in:
Daniel Marjamäki 2008-08-30 16:38:56 +00:00
parent 3daf128c0f
commit 0e267441de
2 changed files with 7 additions and 9 deletions

View File

@ -35,6 +35,7 @@
#include <dir.h> #include <dir.h>
#else #else
#include <glob.h> #include <glob.h>
#include <unistd.h>
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -92,22 +93,19 @@ static void RecursiveAddFiles( std::vector<std::string> &filenames, const char p
#else #else
// gcc / cygwin.. // gcc / cygwin..
glob_t glob_results; glob_t glob_results;
#ifdef __GNUC__ glob("*", GLOB_MARK, 0, &glob_results);
// gcc..
glob("*", GLOB_ONLYDIR, 0, &glob_results);
#else
// cygwin..
glob("*", 0, 0, &glob_results);
#endif
for ( unsigned int i = 0; i < glob_results.gl_pathc; i++ ) for ( unsigned int i = 0; i < glob_results.gl_pathc; i++ )
{ {
const char *dirname = glob_results.gl_pathv[i]; const char *dirname = glob_results.gl_pathv[i];
if ( dirname[0] == '.' ) if ( dirname[0] == '.' )
continue; continue;
if ( strchr(dirname, '/') == 0 )
continue;
chdir( dirname ); chdir( dirname );
std::ostringstream curdir; std::ostringstream curdir;
curdir << path << dirname << "/"; curdir << path << dirname;
RecursiveAddFiles( filenames, curdir.str().c_str() ); RecursiveAddFiles( filenames, curdir.str().c_str() );
chdir( ".." ); chdir( ".." );
} }

View File

@ -683,7 +683,7 @@ void SimplifyTokenList()
free(tok->str); free(tok->str);
char str[10]; char str[10];
// 'sizeof(type *)' has the same size as 'sizeof(char *)' // 'sizeof(type *)' has the same size as 'sizeof(char *)'
sprintf( str, "%d", sizeof(char *)); sprintf( str, "%lu", sizeof(char *));
tok->str = strdup( str ); tok->str = strdup( str );
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)