Fix build after C++ conversion of csync
authorJocelyn Turcotte <jturcotte@woboq.com>
Mon, 4 Sep 2017 15:40:56 +0000 (17:40 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 5 Oct 2017 20:01:04 +0000 (22:01 +0200)
Use the same macro as in SyncFileItem for bitfields on enums.

Fixes #5993

src/csync/csync.h
src/libsync/syncfileitem.h

index e2a8bb62d06d61d97f01b5c4eb01e1a86743a23c..1bda232ff8da490e0ef162dbeeb3f44e8b9cc742 100644 (file)
 #include <memory>
 #include <QByteArray>
 
+#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG) && (__GNUC__ * 100 + __GNUC_MINOR__ < 408)
+// openSuse 12.3 didn't like enum bitfields.
+#define BITFIELD(size)
+#else
+#define BITFIELD(size) :size
+#endif
+
 enum csync_status_codes_e {
   CSYNC_STATUS_OK         = 0,
 
@@ -157,10 +164,10 @@ struct OCSYNC_EXPORT csync_file_stat_s {
   time_t modtime;
   int64_t size;
   uint64_t inode;
-  enum csync_ftw_type_e type  : 4;
-  bool child_modified         : 1;
-  bool has_ignored_files      : 1; /* specify that a directory, or child directory contains ignored files */
-  bool is_hidden              : 1; // Not saved in the DB, only used during discovery for local files.
+  enum csync_ftw_type_e type BITFIELD(4);
+  bool child_modified BITFIELD(1);
+  bool has_ignored_files BITFIELD(1); // Specify that a directory, or child directory contains ignored files.
+  bool is_hidden BITFIELD(1); // Not saved in the DB, only used during discovery for local files.
 
   QByteArray path;
   QByteArray rename_path;
index baa8a75102c7e2917fe7bc2e53402898cc7c34ce..571eabc19d6dbdb4e17323f9cded05de54990753 100644 (file)
 
 #include <csync.h>
 
-#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG) && (__GNUC__ * 100 + __GNUC_MINOR__ < 408)
-// openSuse 12.3 didn't like enum bitfields.
-#define BITFIELD(size)
-#else
-#define BITFIELD(size) :size
-#endif
-
-
 namespace OCC {
 
 /**