spirvfuzz_protobufs.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright (c) 2019 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef SOURCE_FUZZ_SPIRVFUZZ_PROTOBUFS_H_
  15. #define SOURCE_FUZZ_SPIRVFUZZ_PROTOBUFS_H_
  16. // This header file serves to act as a barrier between the protobuf header
  17. // files and files that include them. It uses compiler pragmas to disable
  18. // diagnostics, in order to ignore warnings generated during the processing
  19. // of these header files without having to compromise on freedom from warnings
  20. // in the rest of the project.
  21. #ifndef GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE
  22. #define GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE 1
  23. #endif
  24. #if defined(__clang__)
  25. #pragma clang diagnostic push
  26. #pragma clang diagnostic ignored "-Wunknown-warning-option" // Must come first
  27. #pragma clang diagnostic ignored "-Wreserved-identifier"
  28. #pragma clang diagnostic ignored "-Wshadow"
  29. #pragma clang diagnostic ignored "-Wsuggest-destructor-override"
  30. #pragma clang diagnostic ignored "-Wunused-parameter"
  31. #pragma clang diagnostic ignored "-Wc++98-compat-extra-semi"
  32. #pragma clang diagnostic ignored "-Wshorten-64-to-32"
  33. #elif defined(__GNUC__)
  34. #pragma GCC diagnostic push
  35. #pragma GCC diagnostic ignored "-Wconversion"
  36. #pragma GCC diagnostic ignored "-Wshadow"
  37. #pragma GCC diagnostic ignored "-Wunused-parameter"
  38. #elif defined(_MSC_VER)
  39. #pragma warning(push)
  40. #pragma warning(disable : 4244)
  41. #endif
  42. // The following should be the only place in the project where protobuf files
  43. // are directly included. This is so that they can be compiled in a manner
  44. // where warnings are ignored.
  45. #include "google/protobuf/util/json_util.h"
  46. #include "google/protobuf/util/message_differencer.h"
  47. #include "source/fuzz/protobufs/spvtoolsfuzz.pb.h"
  48. #if defined(__clang__)
  49. #pragma clang diagnostic pop
  50. #elif defined(__GNUC__)
  51. #pragma GCC diagnostic pop
  52. #elif defined(_MSC_VER)
  53. #pragma warning(pop)
  54. #endif
  55. #endif // SOURCE_FUZZ_SPIRVFUZZ_PROTOBUFS_H_