~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to ffcall/vacall/misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 1995-1999, 2003-2005 Bruno Haible, <bruno@clisp.org>
3
 
 *
4
 
 * This is free software distributed under the GNU General Public Licence
5
 
 * described in the file COPYING. Contact the author if you don't have this
6
 
 * or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
7
 
 * on this software.
8
 
 */
9
 
 
10
 
#include <stdio.h>
11
 
#include <stdlib.h>
12
 
 
13
 
#ifndef REENTRANT
14
 
#include "vacall.h"
15
 
#else /* REENTRANT */
16
 
#include "vacall_r.h"
17
 
#endif
18
 
#include "config.h"
19
 
 
20
 
#ifndef REENTRANT
21
 
 
22
 
/* This is the function pointer vacall(). A function pointer indirection is
23
 
   needed because gcc-3.4 generates invalid code when the address of a symbol
24
 
   is casted to a function pointer with different return type.
25
 
   (http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01767.html) */
26
 
#ifdef __cplusplus
27
 
extern "C" void __vacall (); /* the return type is variable, not void! */
28
 
#else
29
 
extern void __vacall (); /* the return type is variable, not void! */
30
 
#endif
31
 
void (*vacall) () = __vacall;
32
 
 
33
 
/* This is the function called by vacall(). */
34
 
void (* vacall_function) (va_alist);
35
 
 
36
 
#endif
37
 
 
38
 
/* Room for returning structs according to the pcc non-reentrant struct return convention. */
39
 
__va_struct_buffer_t __va_struct_buffer;
40
 
 
41
 
int /* no return type, since this never returns */
42
 
__va_error1 (enum __VAtype start_type, enum __VAtype return_type)
43
 
{
44
 
  /* If you see this, fix your code. */
45
 
  fprintf (stderr, "vacall: va_start type %d and va_return type %d disagree.\n",
46
 
                   (int)start_type, (int)return_type);
47
 
  abort();
48
 
#if defined(__cplusplus)
49
 
  return 0;
50
 
#endif
51
 
}
52
 
 
53
 
int /* no return type, since this never returns */
54
 
__va_error2 (unsigned int size)
55
 
{
56
 
  /* If you see this, increase __VA_ALIST_WORDS: */
57
 
  fprintf (stderr, "vacall: struct of size %u too large for pcc struct return.\n",
58
 
                   size);
59
 
  abort();
60
 
#if defined(__cplusplus)
61
 
  return 0;
62
 
#endif
63
 
}