--- a/src/draco/io/stdio_file_writer.cc
+++ b/src/draco/io/stdio_file_writer.cc
@@ -41,7 +41,12 @@ std::unique_ptr<FileWriterInterface> StdioFileWriter::Open(
     return nullptr;
   }
 
+#if (defined(__GNUC__) && (__GNUC___ < 5)) || \
+    (defined(__clang__) && (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 9)))
+  return std::move(file);
+#else
   return file;
+#endif
 }
 
 bool StdioFileWriter::Write(const char *buffer, size_t size) {
