public
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nu.git
Search Repo:
Better error messages for libffi failures, minor iPhone-related changes.

iPhone builds now only include the baked version of nu.nu and no
other Nu library files.
timburks (author)
Thu May 15 15:22:27 -0700 2008
commit  ffc4627f0f655662805e055518a95b8dff2fb701
tree    de74ca354fcaeefd94bdcd3691a8db73b8fa675f
parent  738822c78d5b91857f44af345be4ad21ab46ab6b
...
4
5
6
7
 
8
9
10
...
4
5
6
 
7
8
9
10
0
@@ -4,7 +4,7 @@
0
 ;; source files
0
 (set @c_files (filelistWithRoot "^objc/.*\.c$" ".."))
0
 (set @m_files (filelistWithRoot "^objc/.*\.m$" ".."))
0
-(@m_files unionSet:(filelistWithRoot "^baked/.*\.m$" ".."))
0
+(@m_files unionSet:(filelistWithRoot "^baked/baked_nu\.m$" ".."))
0
 
0
 (case platform
0
       ("iPhone"
...
1157
1158
1159
1160
 
1161
1162
1163
1164
1165
 
1166
1167
1168
1169
1170
 
1171
1172
1173
1174
 
1175
1176
1177
1178
 
1179
1180
1181
1182
 
1183
1184
1185
...
1157
1158
1159
 
1160
1161
1162
1163
1164
 
1165
1166
1167
1168
1169
 
1170
1171
1172
1173
 
1174
1175
1176
1177
 
1178
1179
1180
1181
 
1182
1183
1184
1185
0
@@ -1157,29 +1157,29 @@
0
     argument_types[argument_count] = NULL;
0
     ffi_cif *cif = (ffi_cif *)malloc(sizeof(ffi_cif));
0
     if (cif == NULL) {
0
- NSLog(@"failed to allocate cif structure");
0
+ NSLog(@"unable to prepare closure for signature %s (could not allocate memory for cif structure)", signature);
0
         return NULL;
0
     }
0
     int status = ffi_prep_cif(cif, FFI_DEFAULT_ABI, argument_count, result_type, argument_types);
0
     if (status != FFI_OK) {
0
- NSLog (@"failed to prepare cif structure");
0
+ NSLog(@"unable to prepare closure for signature %s (ffi_prep_cif failed)", signature);
0
         return NULL;
0
     }
0
     ffi_closure *closure = (ffi_closure *)mmap(NULL, sizeof(ffi_closure), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
0
     if (closure == (ffi_closure *) -1) {
0
- NSLog(@"error setting up closure");
0
+ NSLog(@"unable to prepare closure for signature %s (mmap failed with error %d)", signature, errno);
0
         return NULL;
0
     }
0
     if (closure == NULL) {
0
- NSLog(@"error allocating closure");
0
+ NSLog(@"unable to prepare closure for signature %s (could not allocate memory for closure)", signature);
0
         return NULL;
0
     }
0
     if (ffi_prep_closure(closure, cif, objc_calling_nu_method_handler, userdata) != FFI_OK) {
0
- NSLog(@"error creating closure");
0
+ NSLog(@"unable to prepare closure for signature %s (ffi_prep_closure failed)", signature);
0
         return NULL;
0
     }
0
     if (mprotect(closure, sizeof(closure), PROT_READ | PROT_EXEC) == -1) {
0
- NSLog(@"error preparing closure");
0
+ NSLog(@"unable to prepare closure for signature %s (mprotect failed with error %d)", signature, errno);
0
         return NULL;
0
     }
0
     return (IMP) closure;
...
26
27
28
 
29
30
31
...
26
27
28
29
30
31
32
0
@@ -26,6 +26,7 @@
0
 (function generate-handlers (class-name handlers)
0
      (eval (NuTemplate codeForString:<<-END
0
 #import "handler.h"
0
+#import <CoreGraphics/CoreGraphics.h>
0
 
0
 <% (handlers each:(do (group) %>
0
 <%= (generate-handlers-for-type (group 0) (group 2)) %>

Comments

    No one has commented yet.