summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc/f/runtime/libF77/h_sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/gcc/f/runtime/libF77/h_sign.c')
-rw-r--r--gnu/usr.bin/gcc/f/runtime/libF77/h_sign.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gnu/usr.bin/gcc/f/runtime/libF77/h_sign.c b/gnu/usr.bin/gcc/f/runtime/libF77/h_sign.c
new file mode 100644
index 00000000000..7b06c157a74
--- /dev/null
+++ b/gnu/usr.bin/gcc/f/runtime/libF77/h_sign.c
@@ -0,0 +1,12 @@
+#include "f2c.h"
+
+#ifdef KR_headers
+shortint h_sign(a,b) shortint *a, *b;
+#else
+shortint h_sign(shortint *a, shortint *b)
+#endif
+{
+shortint x;
+x = (*a >= 0 ? *a : - *a);
+return( *b >= 0 ? x : -x);
+}