ソースを参照

Only execute the assertion macros if NS_BLOCK_ASSERTIONS is not set. Patch from David E. Wheeler!

ccgus 15 年 前
コミット
bcac8bd59d
3 ファイル変更5 行追加9 行削除
  1. 1 0
      CHANGES_AND_TODO_LIST.txt
  2. 1 0
      CONTRIBUTORS.txt
  3. 3 9
      src/FMDatabase.m

+ 1 - 0
CHANGES_AND_TODO_LIST.txt

@@ -5,6 +5,7 @@ If you would like to contribute some code- awesome!  I just ask that you make it
 
 2010.11.30
     Added and updated some new methods to take NSError** params.
+    Only execute the assertion macros if NS_BLOCK_ASSERTIONS is not set.  Patch from David E. Wheeler!
 
 2010.09.19
     The signature for FMDatabase's executeQuery* methods now return FMResultSet instead if id.  Patch from Augie Fackler!

+ 1 - 0
CONTRIBUTORS.txt

@@ -23,5 +23,6 @@ Matt Stevens
 Jens Alfke
 Pascal Pfiffner
 Augie Fackler
+David E. Wheeler
 
 Aaaaannnd, Gus Mueller (that's me!)

+ 3 - 9
src/FMDatabase.m

@@ -174,7 +174,7 @@ - (BOOL)goodConnection {
 - (void)compainAboutInUse {
     NSLog(@"The FMDatabase %@ is currently in use.", self);
     
-# if !NS_BLOCK_ASSERTIONS
+#if !NS_BLOCK_ASSERTIONS
     if (crashOnErrors) {
         NSAssert1(false, @"The FMDatabase %@ is currently in use.", self);
     }
@@ -302,11 +302,8 @@ - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arr
                 if (logsErrors) {
                     NSLog(@"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                     NSLog(@"DB Query: %@", sql);
-# if !NS_BLOCK_ASSERTIONS
+#if !NS_BLOCK_ASSERTIONS
                     if (crashOnErrors) {
-//#if defined(__BIG_ENDIAN__) && !TARGET_IPHONE_SIMULATOR
-//                        asm{ trap };
-//#endif
                         NSAssert2(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                     }
 #endif
@@ -436,11 +433,8 @@ - (BOOL)executeUpdate:(NSString*)sql error:(NSError**)outErr withArgumentsInArra
                 if (logsErrors) {
                     NSLog(@"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                     NSLog(@"DB Query: %@", sql);
-# if !NS_BLOCK_ASSERTIONS
+#if !NS_BLOCK_ASSERTIONS
                     if (crashOnErrors) {
-//#if defined(__BIG_ENDIAN__) && !TARGET_IPHONE_SIMULATOR
-//                        asm{ trap };
-//#endif
                         NSAssert2(false, @"DB Error: %d \"%@\"", [self lastErrorCode], [self lastErrorMessage]);
                     }
 #endif