some fixes for solaris

master
Marc Wäckerlin 20 years ago
parent be78e35c27
commit 40f522eb3a
  1. 9
      mrw/file.hpp

@ -9,6 +9,9 @@
@license LGPL, see file <a href="license.html">COPYING</a> @license LGPL, see file <a href="license.html">COPYING</a>
$Log$ $Log$
Revision 1.5 2005/03/02 22:03:08 marc
some fixes for solaris
Revision 1.4 2005/02/28 07:17:24 marc Revision 1.4 2005/02/28 07:17:24 marc
Dir is now usable and compilable, also added fixes for Solaris Dir is now usable and compilable, also added fixes for Solaris
@ -253,13 +256,12 @@ namespace mrw {
#ifdef _DIRENT_HAVE_D_TYPE #ifdef _DIRENT_HAVE_D_TYPE
return FileType(_dirent.d.d_type); return FileType(_dirent.d.d_type);
#else #else
return UNKNOWN: return UNKNOWN;
#endif #endif
} }
/// Get the type of the actual file as string. /// Get the type of the actual file as string.
const std::string& typestr() const throw() { const std::string& typestr() const throw() {
#ifdef _DIRENT_HAVE_D_TYPE
static const std::string UNKNOWN_("UNKNOWN"); static const std::string UNKNOWN_("UNKNOWN");
static const std::string REGULAR_("REGULAR"); static const std::string REGULAR_("REGULAR");
static const std::string DIR_("DIR"); static const std::string DIR_("DIR");
@ -267,6 +269,7 @@ namespace mrw {
static const std::string SOCKET_("SOCKET"); static const std::string SOCKET_("SOCKET");
static const std::string CHAR_("CHAR"); static const std::string CHAR_("CHAR");
static const std::string BLOCK_("BLOCK"); static const std::string BLOCK_("BLOCK");
#ifdef _DIRENT_HAVE_D_TYPE
switch (_dirent.d.d_type) { switch (_dirent.d.d_type) {
case UNKNOWN: return UNKNOWN_; case UNKNOWN: return UNKNOWN_;
case REGULAR: return REGULAR_; case REGULAR: return REGULAR_;
@ -278,7 +281,7 @@ namespace mrw {
} }
abort(); // this line is never reached abort(); // this line is never reached
#else #else
return "UNKNOWN"; return UNKNOWN_;
#endif #endif
} }
//.......................................................... variables //.......................................................... variables

Loading…
Cancel
Save