djgpp: Fixed compiler warnings/errors when compiling with DJGPP
This commit is contained in:
parent
3daf128c0f
commit
0e267441de
14
main.cpp
14
main.cpp
|
@ -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( ".." );
|
||||||
}
|
}
|
||||||
|
|
|
@ -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++)
|
||||||
|
|
Loading…
Reference in New Issue