summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-02-16 10:40:55 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-17 05:25:28 -0500
commit4e6c80197f1cc46dfdef0300de46847c7cfbdcb0 (patch)
tree72b3ddcfd121f161f5f611ac250941c1c58296d9 /m4
parent4127e86dfdfcfce60e5029c716c98c244851779a (diff)
downloadhaskell-4e6c80197f1cc46dfdef0300de46847c7cfbdcb0.tar.gz
Always define __GLASGOW_HASKELL_PATCHLEVEL1/2__ macros
As #21076 reports if you are using `-Wcpp-undef` then you get warnings when using the `MIN_VERSION_GLASGOW_HASKELL` macro because __GLASGOW_HASKELL_PATCHLEVEL2__ is very rarely explicitliy set (as version numbers are not 4 components long). This macro was introduced in 3549c952b535803270872adaf87262f2df0295a4 and it seems the bug has existed ever since. Fixes #21076
Diffstat (limited to 'm4')
-rw-r--r--m4/fp_setup_project_version.m44
1 files changed, 4 insertions, 0 deletions
diff --git a/m4/fp_setup_project_version.m4 b/m4/fp_setup_project_version.m4
index 26df01865b..d51759add7 100644
--- a/m4/fp_setup_project_version.m4
+++ b/m4/fp_setup_project_version.m4
@@ -77,6 +77,10 @@ AC_DEFUN([FP_SETUP_PROJECT_VERSION],
ProjectPatchLevel1=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1/'`
ProjectPatchLevel2=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3/'`
+ # The project patchlevel1/2 is zero unless stated otherwise
+ test -z "$ProjectPatchLevel1" && ProjectPatchLevel1=0
+ test -z "$ProjectPatchLevel2" && ProjectPatchLevel2=0
+
AC_SUBST([ProjectPatchLevel1])
AC_SUBST([ProjectPatchLevel2])