[Rprotobuf-commits] r704 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 4 03:15:44 CET 2014


Author: murray
Date: 2014-01-04 03:15:43 +0100 (Sat, 04 Jan 2014)
New Revision: 704

Modified:
   pkg/src/rprotobuf.h
Log:
Add two missing headers found by clang IncludeWhatYouUse, sort
includes, and address a TODO by making O_BINARY definition
conditional.  This is only needed in Windows, but I suppose there is
hope that one day someone might port this package to Windows.



Modified: pkg/src/rprotobuf.h
===================================================================
--- pkg/src/rprotobuf.h	2014-01-04 01:34:42 UTC (rev 703)
+++ pkg/src/rprotobuf.h	2014-01-04 02:15:43 UTC (rev 704)
@@ -21,11 +21,17 @@
 #ifndef RPROTOBUF_H
 #define RPROTOBUF_H
 
+// TODO(mstokely): should we check if this header is available?
+#include <fcntl.h>
+#include <string.h>  // for strerror
 #include <unistd.h>  // g++-4.7 wants this
-/* should we check this is available */
-#include <fcntl.h>
-/* FIXME: need to include some header file instead of this define */
+#include <string>    // for string
+// O_BINARY does not exist on Unix/Linux, since there is no distinction
+// between text mode and binary mode files there, but if we ever got
+// this code running on Windows this would be needed.
+#ifndef O_BINARY
 #define O_BINARY 0
+#endif
 
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/compiler/importer.h>



More information about the Rprotobuf-commits mailing list