OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libobjc/] [nil_method.c] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 jlechner
/* GNU Objective C Runtime nil receiver function
2
   Copyright (C) 1993, 1995, 1996, 2002 Free Software Foundation, Inc.
3
   Contributed by Kresten Krab Thorup
4
 
5
This file is part of GCC.
6
 
7
GCC is free software; you can redistribute it and/or modify it under the
8
terms of the GNU General Public License as published by the Free Software
9
Foundation; either version 2, or (at your option) any later version.
10
 
11
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
14
details.
15
 
16
You should have received a copy of the GNU General Public License along with
17
GCC; see the file COPYING.  If not, write to the Free Software
18
Foundation, 51 Franklin Street, Fifth Floor,
19
Boston, MA 02110-1301, USA.  */
20
 
21
/* As a special exception, if you link this library with files compiled with
22
   GCC to produce an executable, this does not cause the resulting executable
23
   to be covered by the GNU General Public License. This exception does not
24
   however invalidate any other reasons why the executable file might be
25
   covered by the GNU General Public License.  */
26
 
27
/* This is the nil method, the function that is called when the receiver
28
   of a method is nil */
29
 
30
#include "objc/runtime.h"
31
 
32
/* When the receiver of a method invocation is nil, the runtime
33
   returns nil_method() as the method implementation.  This function
34
   will be casted to whatever function was supposed to be executed to
35
   execute that method (that function will take an id, followed by a
36
   SEL, followed by who knows what arguments, depends on the method),
37
   and executed.
38
 
39
   For this reason, nil_method() should be a function which can be
40
   called in place of any function taking an 'id' argument followed by
41
   a 'SEL' argument, followed by zero, or one, or any number of
42
   arguments (both a fixed number, or a variable number !).
43
 
44
   There is no "proper" implementation of such a nil_method function
45
   in C, however in all existing implementations it does not matter
46
   when extra arguments are present, so we can simply create a function
47
   taking a receiver and a selector, and all other arguments will be
48
   ignored. :-)
49
*/
50
 
51
id
52
nil_method (id receiver, SEL op __attribute__ ((__unused__)))
53
{
54
  return receiver;
55
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.