util.h 536 B

12345678910111213141516
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. #pragma once
  6. #ifndef FALLTHROUGH_INTENDED
  7. #if defined(__clang__)
  8. #define FALLTHROUGH_INTENDED [[clang::fallthrough]]
  9. #elif defined(__GNUC__) && __GNUC__ >= 7
  10. #define FALLTHROUGH_INTENDED [[gnu::fallthrough]]
  11. #else
  12. #define FALLTHROUGH_INTENDED do {} while (0)
  13. #endif
  14. #endif