1
0
Fork 0

Remove dirent.h dependency.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3359
This commit is contained in:
Peter Veenstra 2009-04-26 18:24:36 +00:00
parent 4ebdd5114a
commit 8516e5d4bf
6 changed files with 25 additions and 27 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2007 The DOSBox Team
* Copyright (C) 2002-2009 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: cdrom.cpp,v 1.27 2009-04-26 18:24:36 qbix79 Exp $ */
// ******************************************************
// SDL CDROM
@ -24,7 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include "dosbox.h"
#include "SDL.h"
#include "support.h"
@ -172,7 +173,7 @@ int CDROM_GetMountType(char* path, int forceCD) {
// Detect ISO
struct stat file_stat;
if ((stat(path, &file_stat) == 0) && S_ISREG(file_stat.st_mode)) return 1;
if ((stat(path, &file_stat) == 0) && (file_stat.st_mode & S_IFREG)) return 1;
return 2;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2008 The DOSBox Team
* Copyright (C) 2002-2009 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,14 +16,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: drive_local.cpp,v 1.78 2008-10-05 14:44:52 qbix79 Exp $ */
/* $Id: drive_local.cpp,v 1.79 2009-04-26 18:24:36 qbix79 Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <dirent.h>
#include "dosbox.h"
#include "dos_inc.h"
#include "drives.h"
@ -264,7 +264,7 @@ again:
goto again;//No symlinks and such
}
if(S_ISDIR(stat_block.st_mode)) find_attr=DOS_ATTR_DIRECTORY;
if(stat_block.st_mode & S_IFDIR) find_attr=DOS_ATTR_DIRECTORY;
else find_attr=DOS_ATTR_ARCHIVE;
if (~srch_attr & find_attr & (DOS_ATTR_DIRECTORY | DOS_ATTR_HIDDEN | DOS_ATTR_SYSTEM)) goto again;