OLD | NEW |
---|---|
1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 const char* FLAGS_##name = value; \ | 111 const char* FLAGS_##name = value; \ |
112 char FLAGS_no##name; \ | 112 char FLAGS_no##name; \ |
113 } \ | 113 } \ |
114 using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_## name | 114 using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_## name |
115 | 115 |
116 // These macros (could be functions, but I don't want to bother with a .cc | 116 // These macros (could be functions, but I don't want to bother with a .cc |
117 // file), make it easier to initialize flags from the environment. | 117 // file), make it easier to initialize flags from the environment. |
118 // They are functions in Android because __system_property_get() doesn't | 118 // They are functions in Android because __system_property_get() doesn't |
119 // return a string. | 119 // return a string. |
120 | 120 |
121 #if defined(ENABLE_PROFILING) | 121 #if defined(ENABLE_PROFILING) || defined(ENABLE_LEAK_DETECTOR) |
Nico
2015/07/16 19:49:09
This too means you can never ship this to users –
Simon Que
2015/07/16 21:15:08
Then the problem may extend beyond this file. I am
Nico
2015/07/16 21:25:17
Yes.
| |
122 | 122 |
123 #if defined(__ANDROID__) || defined(ANDROID) | 123 #if defined(__ANDROID__) || defined(ANDROID) |
124 | 124 |
125 // Returns a pointer to a static variable. The string pointed by the returned | 125 // Returns a pointer to a static variable. The string pointed by the returned |
126 // pointer must not be modified. | 126 // pointer must not be modified. |
127 inline const char* const EnvToString(const char* envname, const char* dflt) { | 127 inline const char* const EnvToString(const char* envname, const char* dflt) { |
128 static char system_property_value[PROP_VALUE_MAX]; | 128 static char system_property_value[PROP_VALUE_MAX]; |
129 if (__system_property_get(envname, system_property_value) > 0) | 129 if (__system_property_get(envname, system_property_value) > 0) |
130 return system_property_value; | 130 return system_property_value; |
131 return dflt; | 131 return dflt; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 | 183 |
184 #define EnvToString(envname, dflt) (dflt) | 184 #define EnvToString(envname, dflt) (dflt) |
185 #define EnvToBool(envname, dflt) (dflt) | 185 #define EnvToBool(envname, dflt) (dflt) |
186 #define EnvToInt(envname, dflt) (dflt) | 186 #define EnvToInt(envname, dflt) (dflt) |
187 #define EnvToInt64(envname, dflt) (dflt) | 187 #define EnvToInt64(envname, dflt) (dflt) |
188 #define EnvToDouble(envname, dflt) (dflt) | 188 #define EnvToDouble(envname, dflt) (dflt) |
189 | 189 |
190 #endif // defined(ENABLE_PROFILING) | 190 #endif // defined(ENABLE_PROFILING) |
191 | 191 |
192 #endif // BASE_COMMANDLINEFLAGS_H_ | 192 #endif // BASE_COMMANDLINEFLAGS_H_ |
OLD | NEW |