설명 없음

FIRInstanceIDDefines.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef FIRInstanceIDLib_FIRInstanceIDDefines_h
  17. #define FIRInstanceIDLib_FIRInstanceIDDefines_h
  18. #define _FIRInstanceID_VERBOSE_LOGGING 1
  19. // Verbose Logging
  20. #if (_FIRInstanceID_VERBOSE_LOGGING)
  21. #define FIRInstanceID_DEV_VERBOSE_LOG(...) NSLog(__VA_ARGS__)
  22. #else
  23. #define FIRInstanceID_DEV_VERBOSE_LOG(...) \
  24. do { \
  25. } while (0)
  26. #endif // VERBOSE_LOGGING
  27. // WEAKIFY & STRONGIFY
  28. // Helper macro.
  29. #define _FIRInstanceID_WEAKNAME(VAR) VAR##_weak_
  30. #define FIRInstanceID_WEAKIFY(VAR) __weak __typeof__(VAR) _FIRInstanceID_WEAKNAME(VAR) = (VAR);
  31. #define FIRInstanceID_STRONGIFY(VAR) \
  32. _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wshadow\"") \
  33. __strong __typeof__(VAR) VAR = _FIRInstanceID_WEAKNAME(VAR); \
  34. _Pragma("clang diagnostic pop")
  35. // Type Conversions (used for NSInteger etc)
  36. #ifndef _FIRInstanceID_L
  37. #define _FIRInstanceID_L(v) (long)(v)
  38. #endif
  39. #endif