OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // The Objective C runtime has complete enough info that most protos don’t end | 31 // The Objective C runtime has complete enough info that most protos don’t end |
32 // up using this, so leaving it on is no cost or very little cost. If you | 32 // up using this, so leaving it on is no cost or very little cost. If you |
33 // happen to see it causing bloat, this is the way to disable it. If you do | 33 // happen to see it causing bloat, this is the way to disable it. If you do |
34 // need to disable it, try only disabling it for Release builds as having | 34 // need to disable it, try only disabling it for Release builds as having |
35 // full TextFormat can be useful for debugging. | 35 // full TextFormat can be useful for debugging. |
36 #ifndef GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS | 36 #ifndef GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS |
37 #define GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS 0 | 37 #define GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS 0 |
38 #endif | 38 #endif |
39 | 39 |
40 // Most uses of protocol buffers don't need field options, by default the | |
41 // static data will be compiled out, define this to 1 to include it. The only | |
42 // time you need this is if you are doing introspection of the protocol buffers. | |
43 #ifndef GPBOBJC_INCLUDE_FIELD_OPTIONS | |
44 #define GPBOBJC_INCLUDE_FIELD_OPTIONS 0 | |
45 #endif | |
46 | |
47 // Used in the generated code to give sizes to enums. int32_t was chosen based | 40 // Used in the generated code to give sizes to enums. int32_t was chosen based |
48 // on the fact that Protocol Buffers enums are limited to this range. | 41 // on the fact that Protocol Buffers enums are limited to this range. |
49 #if !__has_feature(objc_fixed_enum) | 42 #if !__has_feature(objc_fixed_enum) |
50 #error All supported Xcode versions should support objc_fixed_enum. | 43 #error All supported Xcode versions should support objc_fixed_enum. |
51 #endif | 44 #endif |
52 // If the headers are imported into Objective-C++, we can run into an issue | 45 // If the headers are imported into Objective-C++, we can run into an issue |
53 // where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++ | 46 // where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++ |
54 // standard that is in effect. If it isn't C++11 or higher, the definition | 47 // standard that is in effect. If it isn't C++11 or higher, the definition |
55 // doesn't allow us to forward declare. We work around this one case by | 48 // doesn't allow us to forward declare. We work around this one case by |
56 // providing a local definition. The default case has to use NS_ENUM for the | 49 // providing a local definition. The default case has to use NS_ENUM for the |
(...skipping 25 matching lines...) Expand all Loading... |
82 #endif | 75 #endif |
83 | 76 |
84 // If property name starts with init we need to annotate it to get past ARC. | 77 // If property name starts with init we need to annotate it to get past ARC. |
85 // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-
property-with-an-objc-method-family/18723227#18723227 | 78 // http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-
property-with-an-objc-method-family/18723227#18723227 |
86 #define GPB_METHOD_FAMILY_NONE __attribute__((objc_method_family(none))) | 79 #define GPB_METHOD_FAMILY_NONE __attribute__((objc_method_family(none))) |
87 | 80 |
88 // The protoc-gen-objc version which works with the current version of the | 81 // The protoc-gen-objc version which works with the current version of the |
89 // generated Objective C sources. In general we don't want to change the | 82 // generated Objective C sources. In general we don't want to change the |
90 // runtime interfaces (or this version) as it means everything has to be | 83 // runtime interfaces (or this version) as it means everything has to be |
91 // regenerated. | 84 // regenerated. |
92 #define GOOGLE_PROTOBUF_OBJC_GEN_VERSION 30000 | 85 #define GOOGLE_PROTOBUF_OBJC_GEN_VERSION 30001 |
OLD | NEW |