August Mueller 11 years ago
parent
commit
04ac082376
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/fmdb/FMDatabase.m

+ 2 - 2
src/fmdb/FMDatabase.m

@@ -1242,7 +1242,7 @@ - (void)makeFunctionNamed:(NSString*)name maximumArguments:(int)count withBlock:
 int FMDBSQLiteExecCallBackFunction(void *theBlockAsVoid, int columnCount, char **columnValues, char **columnNames);
 int FMDBSQLiteExecCallBackFunction(void *theBlockAsVoid, int columnCount, char **columnValues, char **columnNames) {
     
-    void (^callbackBlock)(int columnCount, char **columnValues, char **columnNames, BOOL *stop) = theBlockAsVoid;
+    void (^callbackBlock)(int columnCount, char **columnValues, char **columnNames, BOOL *stop) = (__bridge void (^)(int, char **, char **, BOOL *))(theBlockAsVoid);
     
     if (callbackBlock) {
         BOOL shouldStop = NO;
@@ -1261,7 +1261,7 @@ - (int)executeBatch:(NSString*)sql withRowResultBlock:(void (^)(int columnCount,
     
     char *errmsg = nil;
     
-    int errorCode = sqlite3_exec([self sqliteHandle], [sql UTF8String], &FMDBSQLiteExecCallBackFunction, callbackBlock, &errmsg);
+    int errorCode = sqlite3_exec([self sqliteHandle], [sql UTF8String], &FMDBSQLiteExecCallBackFunction, (__bridge void *)(callbackBlock), &errmsg);
     
     
     if (errmsg) {