diff options
author | bsiegert <bsiegert@pkgsrc.org> | 2015-11-08 08:41:48 +0000 |
---|---|---|
committer | bsiegert <bsiegert@pkgsrc.org> | 2015-11-08 08:41:48 +0000 |
commit | ea1a35d99acbbdbcdc4c30951c502fc390b3cb58 (patch) | |
tree | a7303414a2d3f441b7fdc6dac930de784a0c6c11 /x11/gtk3/patches/patch-gtk_fallback-c89.c | |
parent | 54fb617be6ee2dbeeb9363ee140dc08d9d9a7084 (diff) | |
download | pkgsrc-ea1a35d99acbbdbcdc4c30951c502fc390b3cb58.tar.gz |
Pullup ticket #4851 - requested by he
x11/gtk3: build fix
Revisions pulled up:
- x11/gtk3/Makefile 1.70
- x11/gtk3/distinfo 1.32
- x11/gtk3/patches/patch-gtk_fallback-c89.c 1.1
---
Module Name: pkgsrc
Committed By: he
Date: Sat Nov 7 15:49:38 UTC 2015
Modified Files:
pkgsrc/x11/gtk3: Makefile distinfo
Log Message:
Improve compatibility with systems which lack either round(), rint()
or nearbyint(), but might still have them declared in <math.h>.
Bump PKGREVISION.
---
Module Name: pkgsrc
Committed By: he
Date: Sat Nov 7 15:51:40 UTC 2015
Added Files:
pkgsrc/x11/gtk3/patches: patch-gtk_fallback-c89.c
Log Message:
Improve compatibility with systems which lack either round(), rint()
or nearbyint(), but might still have them declared in <math.h>.
Bump PKGREVISION.
Diffstat (limited to 'x11/gtk3/patches/patch-gtk_fallback-c89.c')
-rw-r--r-- | x11/gtk3/patches/patch-gtk_fallback-c89.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/x11/gtk3/patches/patch-gtk_fallback-c89.c b/x11/gtk3/patches/patch-gtk_fallback-c89.c new file mode 100644 index 00000000000..2468fc4382c --- /dev/null +++ b/x11/gtk3/patches/patch-gtk_fallback-c89.c @@ -0,0 +1,49 @@ +$NetBSD: patch-gtk_fallback-c89.c,v 1.2.2.2 2015/11/08 08:41:49 bsiegert Exp $ + +Work around the fact that math.h may declare these functions +non-static. + +--- gtk/fallback-c89.c.orig 2014-03-06 04:42:58.000000000 +0000 ++++ gtk/fallback-c89.c +@@ -22,19 +22,20 @@ + /* Workaround for round() for non-GCC/non-C99 compilers */ + #ifndef HAVE_ROUND + static inline double +-round (double x) ++my_round (double x) + { + if (x >= 0) + return floor (x + 0.5); + else + return ceil (x - 0.5); + } ++#define round(x) my_round(x) + #endif + + /* Workaround for rint() for non-GCC/non-C99 compilers */ + #ifndef HAVE_RINT + static inline double +-rint (double x) ++my_rint (double x) + { + if (ceil (x + 0.5) == floor (x + 0.5)) + { +@@ -53,6 +54,7 @@ rint (double x) + return ceil (x - 0.5); + } + } ++#define rint(x) my_rint(x) + #endif + + #ifndef HAVE_NEARBYINT +@@ -60,8 +62,9 @@ rint (double x) + /* This is quite similar to rint() in most respects */ + + static inline double +-nearbyint (double x) ++my_nearbyint (double x) + { + return floor (x + 0.5); + } ++#define nearbyint(x) my_nearbyint(x) + #endif |