You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 lines
1.2 KiB

  1. // Software License Agreement (BSD License)
  2. //
  3. // Copyright (c) 2010-2015, Deusty, LLC
  4. // All rights reserved.
  5. //
  6. // Redistribution and use of this software in source and binary forms,
  7. // with or without modification, are permitted provided that the following conditions are met:
  8. //
  9. // * Redistributions of source code must retain the above copyright notice,
  10. // this list of conditions and the following disclaimer.
  11. //
  12. // * Neither the name of Deusty nor the names of its contributors may be used
  13. // to endorse or promote products derived from this software without specific
  14. // prior written permission of Deusty, LLC.
  15. /**
  16. * NSAsset replacement that will output a log message even when assertions are disabled.
  17. **/
  18. #define DDAssert(condition, frmt, ...) \
  19. if (!(condition)) { \
  20. NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \
  21. DDLogError(@"%@", description); \
  22. NSAssert(NO, description); \
  23. }
  24. #define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition)