MROGeometry-Prefix.pch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // Prefix header
  3. //
  4. // The contents of this file are implicitly included at the beginning of every source file.
  5. //
  6. //
  7. // Copyright (c) 2010-2015, Marcus Rohrmoser mobile Software
  8. // All rights reserved.
  9. //
  10. // Redistribution and use in source and binary forms, with or without modification, are permitted
  11. // provided that the following conditions are met:
  12. //
  13. // 1. Redistributions of source code must retain the above copyright notice, this list of conditions
  14. // and the following disclaimer.
  15. //
  16. // 2. The software must not be used for military or intelligence or related purposes nor
  17. // anything that's in conflict with human rights as declared in http://www.un.org/en/documents/udhr/ .
  18. //
  19. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  20. // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  21. // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  22. // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  25. // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  26. // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. //
  28. #ifdef __OBJC__
  29. #import <Foundation/Foundation.h>
  30. #ifndef DEBUG
  31. // Ensure DEBUG is defined properly
  32. #if NS_BLOCK_ASSERTIONS
  33. //#error Define -DDEBUG=0 in Project Settings->GCC 4.2 Language->Other C Flags
  34. #define DEBUG 0
  35. #else
  36. #error Define -DDEBUG=1 in Project Settings->GCC 4.2 Language->Other C Flags
  37. #endif
  38. #endif
  39. #if DEBUG
  40. #ifdef NS_BLOCK_ASSERTIONS
  41. #error Don't define -DNS_BLOCK_ASSERTIONS=0 in Project Settings->GCC 4.2 Language->Other C Flags
  42. #endif
  43. // Do Logging
  44. #define MRLogD(x, ...) NSLog(@"DEBUG %s " x, __FUNCTION__, ## __VA_ARGS__)
  45. #define MRLogTStart() const NSTimeInterval debug_timer_start = [[NSProcessInfo processInfo] systemUptime]
  46. #define MRLogT(s, ... ) MRLogD(@"TIME dt=%f " s, ([[NSProcessInfo processInfo] systemUptime] - debug_timer_start), __VA_ARGS__)
  47. #else
  48. #ifndef NS_BLOCK_ASSERTIONS
  49. #error Define -DNS_BLOCK_ASSERTIONS=1 in Project Settings->GCC 4.2 Language->Other C Flags
  50. #endif
  51. #if !NS_BLOCK_ASSERTIONS
  52. #error Define -DNS_BLOCK_ASSERTIONS=1 in Project Settings->GCC 4.2 Language->Other C Flags
  53. #endif
  54. // No Logging
  55. #define MRLogD(x, ...) /* NSLog(x,##__VA_ARGS__) */
  56. #define NSLog(x, ...) /* NSLog(x,##__VA_ARGS__) */
  57. #define MRLogTStart()
  58. #define MRLogT(s, ... )
  59. #endif
  60. #endif