summaryrefslogtreecommitdiffstats
path: root/src/fs.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-14 21:02:01 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-14 21:02:01 +0000
commit4032f92867e5570f130e4175b3b4fb61240f9752 (patch)
tree4e56172ca9f3f586d85d912a487357d9fe3496ed /src/fs.c
parent7a6b6a56dabe1e62a0fbc6222c090aa077bcadc7 (diff)
downloadlibrcc-4032f92867e5570f130e4175b3b4fb61240f9752.tar.gz
librcc-4032f92867e5570f130e4175b3b4fb61240f9752.tar.bz2
librcc-4032f92867e5570f130e4175b3b4fb61240f9752.tar.xz
librcc-4032f92867e5570f130e4175b3b4fb61240f9752.zip
0.1.0
Diffstat (limited to 'src/fs.c')
-rw-r--r--src/fs.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/fs.c b/src/fs.c
index ba3ce34..abf45b0 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -1,10 +1,24 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <mntent.h>
+
+#include "../config.h"
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef HAVE_MNTENT_H
+# include <mntent.h>
+#endif /* HAVE_MNTENT_H */
#include "internal.h"
#include "rcciconv.h"
@@ -75,6 +89,7 @@ int rccFS0(rcc_language_config config, const char *fspath, const char *filename,
if (!len) return 1;
if (!strncmp(filename, fspath, len)) tmp = filename + strlen(fspath);
+#ifdef HAVE_MNTENT_H
} else {
lastprefix = config->ctx->lastprefix;
@@ -102,6 +117,7 @@ int rccFS0(rcc_language_config config, const char *fspath, const char *filename,
}
endmntent(mtab);
}
+#endif /* HAVE_MNTENT_H */
}
if (!tmp) return 1;