path: root/goo
diff options
authorChristian Persch <>2019-01-05 23:50:24 +0100
committerChristian Persch <>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')
2 files changed, 8 insertions, 0 deletions
diff --git a/goo/ b/goo/
index 61704759..e7710b5d 100644
--- a/goo/
+++ b/goo/
@@ -285,6 +285,8 @@ static bool makeFileDescriptorCloexec(int fd) {
+#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) {
FILE *openFile(const char *path, const char *mode) {
#ifdef _WIN32
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);
// 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