OLD | NEW |
1 // Copyright (C) 2013 The Libphonenumber Authors | 1 // Copyright (C) 2013 The Libphonenumber Authors |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 // Author: Philippe Liard | 15 // Author: Philippe Liard |
16 | 16 |
17 #ifndef I18N_PHONENUMBERS_BASE_THREAD_SAFETY_CHECK_H_ | 17 #ifndef I18N_PHONENUMBERS_BASE_THREAD_CHECKER_H_ |
18 #define I18N_PHONENUMBERS_BASE_THREAD_SAFETY_CHECK_H_ | 18 #define I18N_PHONENUMBERS_BASE_THREAD_CHECKER_H_ |
19 | 19 |
20 #if !defined(I18N_PHONENUMBERS_USE_BOOST) | 20 #if !defined(I18N_PHONENUMBERS_USE_BOOST) |
21 | 21 |
22 // Note that I18N_PHONENUMBERS_NO_THREAD_SAFETY must be defined only to let the | 22 // Note that I18N_PHONENUMBERS_NO_THREAD_SAFETY must be defined only to let the |
23 // user of the library know that it can't be used in a thread-safe manner when | 23 // user of the library know that it can't be used in a thread-safe manner when |
24 // it is not depending on Boost. | 24 // it is not depending on Boost. |
25 #if !defined(I18N_PHONENUMBERS_NO_THREAD_SAFETY) | 25 #if !defined(I18N_PHONENUMBERS_NO_THREAD_SAFETY) |
26 #error "Building without Boost, please provide -DNO_THREAD_SAFETY" | 26 #error Building without Boost, please provide \ |
| 27 -DI18N_PHONENUMBERS_NO_THREAD_SAFETY |
27 #endif | 28 #endif |
28 | 29 |
29 #endif | 30 #endif |
30 | 31 |
31 #if !defined(NDEBUG) && !defined(I18N_PHONENUMBERS_USE_BOOST) && \ | 32 #if !defined(NDEBUG) && !defined(I18N_PHONENUMBERS_USE_BOOST) && \ |
32 (defined(__linux__) || defined(__apple__)) | 33 (defined(__linux__) || defined(__apple__)) |
33 | 34 |
34 #include <pthread.h> | 35 #include <pthread.h> |
35 | 36 |
36 namespace i18n { | 37 namespace i18n { |
(...skipping 21 matching lines...) Expand all Loading... |
58 bool CalledOnValidThread() const { | 59 bool CalledOnValidThread() const { |
59 return true; | 60 return true; |
60 } | 61 } |
61 }; | 62 }; |
62 | 63 |
63 #endif | 64 #endif |
64 | 65 |
65 } // namespace phonenumbers | 66 } // namespace phonenumbers |
66 } // namespace i18n | 67 } // namespace i18n |
67 | 68 |
68 #endif // I18N_PHONENUMBERS_BASE_THREAD_SAFETY_CHECK_H_ | 69 #endif // I18N_PHONENUMBERS_BASE_THREAD_CHECKER_H_ |
OLD | NEW |