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 15 #ifndef SOURCE_FUZZ_SPIRVFUZZ_PROTOBUFS_H_ 16 #define SOURCE_FUZZ_SPIRVFUZZ_PROTOBUFS_H_ 17 18 // This header file serves to act as a barrier between the protobuf header 19 // files and files that include them. It uses compiler pragmas to disable 20 // diagnostics, in order to ignore warnings generated during the processing 21 // of these header files without having to compromise on freedom from warnings 22 // in the rest of the project. 23 24 #ifndef GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE 25 #define GOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE 1 26 #endif 27 28 #if defined(__clang__) 29 #pragma clang diagnostic push 30 #pragma clang diagnostic ignored "-Wunknown-warning-option" // Must come first 31 #pragma clang diagnostic ignored "-Wreserved-identifier" 32 #pragma clang diagnostic ignored "-Wshadow" 33 #pragma clang diagnostic ignored "-Wsuggest-destructor-override" 34 #pragma clang diagnostic ignored "-Wunused-parameter" 35 #pragma clang diagnostic ignored "-Wc++98-compat-extra-semi" 36 #pragma clang diagnostic ignored "-Wshorten-64-to-32" 37 #elif defined(__GNUC__) 38 #pragma GCC diagnostic push 39 #pragma GCC diagnostic ignored "-Wconversion" 40 #pragma GCC diagnostic ignored "-Wshadow" 41 #pragma GCC diagnostic ignored "-Wunused-parameter" 42 #elif defined(_MSC_VER) 43 #pragma warning(push) 44 #pragma warning(disable : 4244) 45 #endif 46 47 // The following should be the only place in the project where protobuf files 48 // are directly included. This is so that they can be compiled in a manner 49 // where warnings are ignored. 50 51 #include "google/protobuf/util/json_util.h" 52 #include "google/protobuf/util/message_differencer.h" 53 #include "source/fuzz/protobufs/spvtoolsfuzz.pb.h" 54 55 #if defined(__clang__) 56 #pragma clang diagnostic pop 57 #elif defined(__GNUC__) 58 #pragma GCC diagnostic pop 59 #elif defined(_MSC_VER) 60 #pragma warning(pop) 61 #endif 62 63 #endif // SOURCE_FUZZ_SPIRVFUZZ_PROTOBUFS_H_ 64