Skip to content

Commit 0e26744

Browse files
author
Daniel Marjamäki
committed
djgpp: Fixed compiler warnings/errors when compiling with DJGPP
1 parent 3daf128 commit 0e26744

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

main.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <dir.h>
3636
#else
3737
#include <glob.h>
38+
#include <unistd.h>
3839
#endif
3940

4041
//---------------------------------------------------------------------------
@@ -92,22 +93,19 @@ static void RecursiveAddFiles( std::vector<std::string> &filenames, const char p
9293
#else
9394
// gcc / cygwin..
9495
glob_t glob_results;
95-
#ifdef __GNUC__
96-
// gcc..
97-
glob("*", GLOB_ONLYDIR, 0, &glob_results);
98-
#else
99-
// cygwin..
100-
glob("*", 0, 0, &glob_results);
101-
#endif
96+
glob("*", GLOB_MARK, 0, &glob_results);
10297
for ( unsigned int i = 0; i < glob_results.gl_pathc; i++ )
10398
{
10499
const char *dirname = glob_results.gl_pathv[i];
105100
if ( dirname[0] == '.' )
106101
continue;
107102

103+
if ( strchr(dirname, '/') == 0 )
104+
continue;
105+
108106
chdir( dirname );
109107
std::ostringstream curdir;
110-
curdir << path << dirname << "/";
108+
curdir << path << dirname;
111109
RecursiveAddFiles( filenames, curdir.str().c_str() );
112110
chdir( ".." );
113111
}

tokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ void SimplifyTokenList()
683683
free(tok->str);
684684
char str[10];
685685
// 'sizeof(type *)' has the same size as 'sizeof(char *)'
686-
sprintf( str, "%d", sizeof(char *));
686+
sprintf( str, "%lu", sizeof(char *));
687687
tok->str = strdup( str );
688688

689689
for (int i = 0; i < 4; i++)

0 commit comments

Comments
 (0)