(wangle) s/continuation_/callback/ (missed some)
[folly.git] / folly / Bits.h
index 6b2fef765466d82273d968b23dd9308b2b21ad30..491fcf70007521707a9198e7be2a113ea94b48ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2014 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@
 #ifndef FOLLY_BITS_H_
 #define FOLLY_BITS_H_
 
-#include "folly/Portability.h"
+#include <folly/Portability.h>
 
 #ifndef __GNUC__
 #error GCC required
 #endif
 
 #ifndef FOLLY_NO_CONFIG
-#include "folly/folly-config.h"
+#include <folly/folly-config.h>
 #endif
 
-#include "folly/detail/BitsDetail.h"
-#include "folly/detail/BitIteratorDetail.h"
-#include "folly/Likely.h"
+#include <folly/detail/BitsDetail.h>
+#include <folly/detail/BitIteratorDetail.h>
+#include <folly/Likely.h>
 
 #if FOLLY_HAVE_BYTESWAP_H
 # include <byteswap.h>
@@ -385,11 +385,14 @@ class BitIterator
    * Construct a BitIterator that points at a given bit offset (default 0)
    * in iter.
    */
+  #pragma GCC diagnostic push // bitOffset shadows a member
+  #pragma GCC diagnostic ignored "-Wshadow"
   explicit BitIterator(const BaseIter& iter, size_t bitOffset=0)
     : bititerator_detail::BitIteratorBase<BaseIter>::type(iter),
       bitOffset_(bitOffset) {
     assert(bitOffset_ < bitsPerBlock());
   }
+  #pragma GCC diagnostic pop
 
   size_t bitOffset() const {
     return bitOffset_;
@@ -521,6 +524,7 @@ template <class T, class Enable=void> struct Unaligned;
 /**
  * Representation of an unaligned value of a POD type.
  */
+FOLLY_PACK_PUSH
 template <class T>
 struct Unaligned<
     T,
@@ -528,7 +532,8 @@ struct Unaligned<
   Unaligned() = default;  // uninitialized
   /* implicit */ Unaligned(T v) : value(v) { }
   T value;
-} __attribute__((packed));
+} FOLLY_PACK_ATTR;
+FOLLY_PACK_POP
 
 /**
  * Read an unaligned value of type T and return it.
@@ -553,4 +558,3 @@ inline void storeUnaligned(void* p, T value) {
 }  // namespace folly
 
 #endif /* FOLLY_BITS_H_ */
-