You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
3.2 KiB
83 lines
3.2 KiB
From dc262b45ae8c63be64fa38c7db0296e0d3889895 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
Date: Wed, 7 Jun 2023 17:30:18 +0200
|
|
Subject: [PATCH] Port to C99
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Port the ccc build configuration detection tool to C99 by
|
|
specifying the return type of main as int.
|
|
|
|
Submitted upstream:
|
|
|
|
<https://groups.google.com/g/lp_solve/c/WjVf0dxrwfQ/m/rKMwf57tAwAJ>
|
|
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
---
|
|
bfp/bfp_LUSOL/ccc | 2 +-
|
|
lp_solve/ccc | 4 ++--
|
|
lpsolve55/ccc | 4 ++--
|
|
3 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/bfp/bfp_LUSOL/ccc b/bfp/bfp_LUSOL/ccc
|
|
index 86b274c..a349345 100644
|
|
--- a/bfp/bfp_LUSOL/ccc
|
|
+++ b/bfp/bfp_LUSOL/ccc
|
|
@@ -7,7 +7,7 @@ c=${CC:-cc}
|
|
>/tmp/platform.c
|
|
echo '#include <stdlib.h>'>>/tmp/platform.c
|
|
echo '#include <stdio.h>'>>/tmp/platform.c
|
|
-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
|
|
+echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c
|
|
$c $CFLAGS /tmp/platform.c $LDFLAGS -o /tmp/platform
|
|
PLATFORM=`/tmp/platform`
|
|
rm /tmp/platform /tmp/platform.c >/dev/null 2>&1
|
|
diff --git a/lp_solve/ccc b/lp_solve/ccc
|
|
index 83f21df..2e99f39 100644
|
|
--- a/lp_solve/ccc
|
|
+++ b/lp_solve/ccc
|
|
@@ -8,7 +8,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
|
|
>"$MYTMP"/platform.c
|
|
echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
|
|
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
|
|
-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
|
|
+echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
|
|
$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform
|
|
PLATFORM=`"$MYTMP"/platform`
|
|
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
|
|
@@ -22,7 +22,7 @@ math=-lm
|
|
echo '#include <stdio.h>'>>"$MYTMP"/isnan.c
|
|
echo '#include <stdlib.h>'>>"$MYTMP"/isnan.c
|
|
echo '#include <math.h>'>>"$MYTMP"/isnan.c
|
|
-echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
|
|
+echo 'int main(void){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
|
|
$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1
|
|
if [ $? = 0 ]
|
|
then NOISNAN=
|
|
diff --git a/lpsolve55/ccc b/lpsolve55/ccc
|
|
index 49cd7dc..59c720f 100644
|
|
--- a/lpsolve55/ccc
|
|
+++ b/lpsolve55/ccc
|
|
@@ -8,7 +8,7 @@ MYTMP=`mktemp -d "${TMPDIR:-/tmp}"/lp_solve_XXXXXX`
|
|
>"$MYTMP"/platform.c
|
|
echo '#include <stdlib.h>'>>"$MYTMP"/platform.c
|
|
echo '#include <stdio.h>'>>"$MYTMP"/platform.c
|
|
-echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
|
|
+echo 'int main(void){printf("ux%d", (int) (sizeof(void *)*8));}'>>"$MYTMP"/platform.c
|
|
$c $CFLAGS "$MYTMP"/platform.c $LDFLAGS -o "$MYTMP"/platform
|
|
PLATFORM=`"$MYTMP"/platform`
|
|
rm "$MYTMP"/platform "$MYTMP"/platform.c >/dev/null 2>&1
|
|
@@ -20,7 +20,7 @@ mkdir bin bin/$PLATFORM >/dev/null 2>&1
|
|
echo '#include <stdio.h>'>>"$MYTMP"/isnan.c
|
|
echo '#include <stdlib.h>'>>"$MYTMP"/isnan.c
|
|
echo '#include <math.h>'>>"$MYTMP"/isnan.c
|
|
-echo 'main(){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
|
|
+echo 'int main(void){isnan(0.0);return 0;}'>>"$MYTMP"/isnan.c
|
|
$c $CFLAGS "$MYTMP"/isnan.c $LDFLAGS -o "$MYTMP"/isnan $math >/dev/null 2>&1
|
|
if [ $? = 0 ]
|
|
then NOISNAN=
|
|
--
|
|
2.40.1
|
|
|