summaryrefslogtreecommitdiff
path: root/mcon/U/d_regparm.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/d_regparm.U')
-rw-r--r--mcon/U/d_regparm.U48
1 files changed, 48 insertions, 0 deletions
diff --git a/mcon/U/d_regparm.U b/mcon/U/d_regparm.U
new file mode 100644
index 0000000..f1d03a5
--- /dev/null
+++ b/mcon/U/d_regparm.U
@@ -0,0 +1,48 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2006, Christian Biere
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?MAKE:d_regparm: Myread Setvar cat rm cc ccflags ldflags gccversion
+?MAKE: -pick add $@ %<
+?S:d_regparm:
+?S: This variable conditionally defines the HAS_REGPARM symbol, which
+?S: indicates to the C program that attribute regparm is available.
+?S:.
+?C:HAS_REGPARM:
+?C: This symbol is defined when __attribute__((__regparm__(n))) can be used.
+?C:.
+?H:#$d_regparm HAS_REGPARM
+?H:.
+?LINT:set d_regparm
+: check whether '__attribute__((__regparm__(n)))' can be used
+val="$undef"
+if [ "x$gccversion" != x ]
+then
+ $cat >try.c <<'EOC'
+static __attribute__((__regparm__(1))) int
+blah(int x)
+{
+ return x / 2;
+}
+int main(int argc, char *argv[])
+{
+ (void) argv;
+ return blah(argc);
+}
+EOC
+ if $cc $ccflags -Werror $ldflags -o try try.c >/dev/null 2>&1
+ then
+ val="$define"
+ fi
+ $rm -rf try try.*
+fi
+
+set d_regparm
+eval $setvar
+