Porting NSMethodSignature implies defining the below macros,
similar with the way NSInvocation is ported to a new platform. As
with the NSInvocation's macros, this code will probably also move
in the Objective-C runtime library, to take advantage of the compiler's
knowledge on the target system.
CUMULATIVE_ARGS
INIT_CUMULATIVE_ARGS
FUNCTION_ARG_ENCODING
The name of this macros are the same with the similar ones from the GNU CC compiler. However they don't correspond neither in semantics nor in the argument types.
CUMULATIVE_ARGS is the data type of a variable used to hold about
arguments processed so far. On a machine where all the arguments are
passed on stack, this type is usually int.
INIT_CUMULATIVE_ARGS should initialize the variable of type
CUMULATIVE_ARGS described above.
FUNCTION_ARG_ENCODING determines the encoding of the next
argument of a method. It must produce a NSString describing the
Objective-C encoding and position of the argument in the arguments frame
of the method.
If you want to determine how to write the encoding for a new machine you could use the program generated by signature-test.pl perl script in FoundationTestsuite. This generates a class with a lot of methods. You can look at the output of the program to see how the compiler encodes the methods. Also take a look in the `objc-act.c' file in the compiler to see how the methods are encoded.
Go to the first, previous, next, last section, table of contents.