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

« back to all changes in this revision

Viewing changes to ffcall/m4/ffcall-smallstruct.m4

  • 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
 
dnl Copyright (C) 1993-2005 Free Software Foundation, Inc.
2
 
dnl This file is free software, distributed under the terms of the GNU
3
 
dnl General Public License.  As a special exception to the GNU General
4
 
dnl Public License, this file may be distributed as part of a program
5
 
dnl that contains a configuration script generated by Autoconf, under
6
 
dnl the same distribution terms as the rest of that program.
7
 
 
8
 
dnl From Bruno Haible, Marcus Daniels.
9
 
 
10
 
AC_PREREQ(2.13)
11
 
 
12
 
AC_DEFUN([CL_SMALL_STRUCT_RETURN],
13
 
[AC_CACHE_CHECK([whether small structs are returned in registers], cl_cv_c_struct_return_small, [
14
 
AC_TRY_RUN(GL_NOCRASH[
15
 
typedef struct { long x; } foo; long y;
16
 
foo foofun () { foo f; f.x = y; return f; }
17
 
long (*fun) () = (long (*) ()) foofun;
18
 
int main()
19
 
{ nocrash_init();
20
 
  y = 37; if ((*fun)() != 37) exit(1);
21
 
  y = 55; if ((*fun)() != 55) exit(1);
22
 
  exit(0);
23
 
}], cl_cv_c_struct_return_small=yes, cl_cv_c_struct_return_small=no,
24
 
dnl When cross-compiling, don't assume anything.
25
 
dnl There are even weirder return value passing conventions than pcc.
26
 
cl_cv_c_struct_return_small="guessing no")
27
 
])
28
 
case "$cl_cv_c_struct_return_small" in
29
 
  *yes) AC_DEFINE(__SMALL_STRUCT_RETURN__) ;;
30
 
  *no) ;;
31
 
esac
32
 
])