From a6bf8d5c754dcde068dedd2e826ae95af50c197e Mon Sep 17 00:00:00 2001
From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Date: Tue, 24 Nov 2009 11:36:53 +0100
Subject: [PATCH 1/2] Fix AC_FUNC_MMAP regression with C++ compiler in 2.65.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* lib/autoconf/functions.m4 (AC_FUNC_MMAP): Use const char*
for the constant string. Cast void* to char* for assignment.
* NEWS, THANKS: Update.
Report by Michal Čihař.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
---
ChangeLog | 8 ++++++++
NEWS | 2 ++
THANKS | 1 +
lib/autoconf/functions.m4 | 7 ++++---
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git ChangeLog ChangeLog
index d8d0f9b..521ef79 100644
|
|
|
| 1 | 2009-11-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> |
| 2 | |
| 3 | Fix AC_FUNC_MMAP regression with C++ compiler in 2.65. |
| 4 | * lib/autoconf/functions.m4 (AC_FUNC_MMAP): Use const char* |
| 5 | for the constant string. Cast void* to char* for assignment. |
| 6 | * NEWS, THANKS: Update. |
| 7 | Report by Michal Čihař. |
| 8 | |
1 | 9 | 2009-11-21 Eric Blake <ebb9@byu.net> |
2 | 10 | |
3 | 11 | Release Version 2.65. |
diff --git NEWS NEWS
index b72eb17..d05b78c 100644
|
|
|
1 | 1 | GNU Autoconf NEWS - User visible changes. |
2 | 2 | |
| 3 | ** AC_FUNC_MMAP works in C++ mode again. Regression introduced in 2.65. |
| 4 | |
3 | 5 | * Major changes in Autoconf 2.65 (2009-11-21) [stable] |
4 | 6 | Released by Eric Blake, based on git versions 2.64.*. |
5 | 7 | |
diff --git THANKS THANKS
index b288163..fdd6930 100644
|
|
Matthew D. Langston langston@SLAC.Stanford.EDU |
250 | 250 | Matthew Mueller donut@azstarnet.com |
251 | 251 | Matthew Woehlke mw_triad@users.sourceforge.net |
252 | 252 | Matthias Andree matthias.andree@gmx.de |
| 253 | Michal Čihař nijel@debian.org |
253 | 254 | Michael Elizabeth Chastain chastain@cygnus.com |
254 | 255 | Michael Jenning ? |
255 | 256 | Michael Matz matz@kde.org |
diff --git lib/autoconf/functions.m4 lib/autoconf/functions.m4
index 6b6e7fc..14a8cb9 100644
|
|
int |
1258 | 1258 | main () |
1259 | 1259 | { |
1260 | 1260 | char *data, *data2, *data3; |
| 1261 | const char *cdata2; |
1261 | 1262 | int i, pagesize; |
1262 | 1263 | int fd, fd2; |
1263 | 1264 | |
… |
… |
main () |
1282 | 1283 | fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); |
1283 | 1284 | if (fd2 < 0) |
1284 | 1285 | return 4; |
1285 | | data2 = ""; |
1286 | | if (write (fd2, data2, 1) != 1) |
| 1286 | cdata2 = ""; |
| 1287 | if (write (fd2, cdata2, 1) != 1) |
1287 | 1288 | return 5; |
1288 | | data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); |
| 1289 | data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); |
1289 | 1290 | if (data2 == MAP_FAILED) |
1290 | 1291 | return 6; |
1291 | 1292 | for (i = 0; i < pagesize; ++i) |