summaryrefslogtreecommitdiff
path: root/goo
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2019-01-05 23:50:24 +0100
committerChristian Persch <chpe@src.gnome.org>2019-01-05 23:50:24 +0100
commitaed1af47a2f1adde4e47836798346674f84b873a (patch)
tree866651bf1dfa28147db8da6ca33518e977935ce1 /goo
parent01e963c4f89f47a883c27c597cdf7bf361e8f1ce (diff)
gfile: Fix the build on WIN32
The openFileDescriptor function is not user in the WIN32 codepaths, so just #ifdef it out on WIN32.
Diffstat (limited to 'goo')
-rw-r--r--goo/gfile.cc4
-rw-r--r--goo/gfile.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/goo/gfile.cc b/goo/gfile.cc
index 61704759..e7710b5d 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -285,6 +285,8 @@ static bool makeFileDescriptorCloexec(int fd) {
#endif
}
+#ifndef _WIN32
+
int openFileDescriptor(const char *path, int flags) {
#ifdef O_CLOEXEC
return open(path, flags | O_CLOEXEC);
@@ -302,6 +304,8 @@ int openFileDescriptor(const char *path, int flags) {
#endif
}
+#endif
+
FILE *openFile(const char *path, const char *mode) {
#ifdef _WIN32
OSVERSIONINFO version;
diff --git a/goo/gfile.h b/goo/gfile.h
index 680f70dd..e6ab2d92 100644
--- a/goo/gfile.h
+++ b/goo/gfile.h
@@ -89,8 +89,12 @@ typedef long long Goffset;
// string, denoting the current directory). Returns <path>.
extern GooString *appendToPath(GooString *path, const char *fileName);
+#ifndef _WIN32
// Open a file descriptor
+// Could be implemented on WIN32 too, but the only external caller of
+// this function is not used on WIN32
extern int openFileDescriptor(const char *path, int flags);
+#endif
// Open a file. On Windows, this converts the path from UTF-8 to
// UCS-2 and calls _wfopen (if available). On other OSes, this simply