Re: [Chicken-hackers] [PATCH] Fix MAKEDIR_COMMAND when INSTALL_PROGRAM is set

2015-06-17 Thread Peter Bex
On Fri, Jun 12, 2015 at 04:16:30PM +0200, Michele La Monaca wrote:
> Hi,
> 
> I've noticed that INSTALL_PROGRAM is not used to create directories.
> The attached patch fixes this behavior.

I was testing on Mingw with MSYS and noticed that this change caused the
installation to break on that platform.

Turns out the Makefile for mingw-msys sets INSTALL_PROGRAM to 'cp',
but it doesn't specify MAKEDIR_COMMAND, so it will happily try to
invoke "cp -d -m 755 /path/to/chicken".

Attached is a fix for this platform.  Please apply to master and
chicken-5.

Cheers,
Peter
From 6597b03f867f9613eb51717f9c8c9754fd87fa85 Mon Sep 17 00:00:00 2001
From: Peter Bex 
Date: Wed, 17 Jun 2015 23:23:05 +0200
Subject: [PATCH] Fix Mingw-MSYS build: mkdir program was not set, and install
 was set to 'cp'.

Fixes regression caused by f62a7f5798cfc8cedae791f6d39a94a1123ed9b6.
---
 Makefile.mingw-msys | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile.mingw-msys b/Makefile.mingw-msys
index 5e64fc7..c15ecda 100644
--- a/Makefile.mingw-msys
+++ b/Makefile.mingw-msys
@@ -70,6 +70,8 @@ INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS = -r
 INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS = -r
 INSTALL_PROGRAM_EXECUTABLE_OPTIONS = -r
 INSTALL_PROGRAM_FILE_OPTIONS = -r
+MAKEDIR_COMMAND = mkdir
+MAKEDIR_COMMAND_OPTIONS = -p
 
 # special files
 
-- 
2.1.4



signature.asc
Description: Digital signature
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] [Chicken-announce] CHICKEN 4.10.0 release candidate 1 available

2015-06-17 Thread Moritz Heidkamp
On 10 June 2015 20:39 CEST, Mario Domenech Goulart wrote:

> I've found a small regression related to substring-index[-ci].  I hope
> the attached patch fixes it.

For posterity: Mario and I poked away at this one a bit more via IRC and
found a few more issues. Eventually, a modified version of this patch
(along with a handful of additional tests) was applied to prerelease
(dde858e), master (e6723de) and chicken-5 (5de5c6e).

We'll prepare a new RC soon. Thanks for all the test results so far!

Moritz


signature.asc
Description: PGP signature
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] Including chicken.h fails for C++11

2015-06-17 Thread Peter Bex
On Sun, Jun 14, 2015 at 11:37:17PM +0200, felix.winkelm...@bevuta.com wrote:
> > It was introduced in changeset fcc7e346c63e24be91337df9a3ad30d0c5360144
> > in December 2009.
> >
> 
> I can't recall. Perhaps because of insufficient mathlib support on
> MingW, or for some other obscure reason.

If that was the reason, it can surely be dropped because the GNU check
was replaced by a linux check later.

I've tested on Linux, and the attached patches fix the problem and compile
fine with normal C as well.  I also got rid of a few warnings by wrapping
some more static strings in C_text() calls (which does nothing in C mode, but
in C++ mode it will add an explicit cast from string to C_char *).

I vote for also applying this to prerelease, as it is a reasonably
simple change and it fixes a real problem with C++.

Cheers,
Peter
From 9c11206bc89a3760ecc3e5aaa1210ccc32de6817 Mon Sep 17 00:00:00 2001
From: Peter Bex 
Date: Wed, 17 Jun 2015 20:19:48 +0200
Subject: [PATCH] Fix compiler error in C++ strict mode.

Fixes a few "deprecated string to char * cast" warnings too.
Thanks to Izaak for pointing out this was broken.
---
 NEWS  |  2 ++
 chicken.h | 42 +++---
 2 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/NEWS b/NEWS
index fcb823c..b898bc0 100644
--- a/NEWS
+++ b/NEWS
@@ -91,6 +91,8 @@
   - Removed deprecated C_get_argument[_2] and
 C_get_environment_variable[_2] functions.
   - C_mutate2 has been deprecated in favor of C_mutate
+  - chicken.h can be included in C++ programs in strict C++11 mode
+ without compiler errors on Linux (thanks to "Izaak").
 
 - Foreign function interface
   - The foreign type specifier "scheme-pointer" now accepts an optional
diff --git a/chicken.h b/chicken.h
index 04f2cc2..f53fb3d 100644
--- a/chicken.h
+++ b/chicken.h
@@ -944,7 +944,7 @@ DECL_C_PROC_p0 (128,  1,0,0,0,0,0,0,0)
 # define C__STR(x) #x
 # define C__CHECK_panic(a,s,f,l)   \
   ((a) ? (void)0 : \
-   C_panic_hook("Low-level type assertion " s " failed at " f ":" C__STR(l)))
+   C_panic_hook(C_text("Low-level type assertion " s " failed at " f ":" C__STR(l
 # define C__CHECK_core(v,a,s,x) \
   ({ struct {   \
   typeof(v) n1; \
@@ -1085,10 +1085,6 @@ DECL_C_PROC_p0 (128,  1,0,0,0,0,0,0,0)
 # define C_access   access
 # define C_getpid   getpid
 # define C_getenv   getenv
-# ifdef __linux__
-extern double round(double);
-extern double trunc(double);
-# endif
 #else
 /* provide this file and define C_PROVIDE_LIBC_STUBS if you want to use
your own libc-replacements or -wrappers */
@@ -1401,8 +1397,8 @@ extern double trunc(double);
 
 #define C_tty_portp(p)  C_mk_bool(isatty(fileno(C_port_file(p
 
-#define C_emit_eval_trace_info(x, y, z) C_emit_trace_info2("", x, y, z)
-#define C_emit_syntax_trace_info(x, y, z) C_emit_trace_info2("", x, y, z)
+#define C_emit_eval_trace_info(x, y, z) C_emit_trace_info2(C_text(""), x, y, z)
+#define C_emit_syntax_trace_info(x, y, z) C_emit_trace_info2(C_text(""), x, y, z)
 
 /* These expect C_VECTOR_TYPE to be 0: */
 #define C_vector_to_structure(v)(C_block_header(v) |= C_STRUCTURE_TYPE, C_SCHEME_UNDEFINED)
@@ -2996,7 +2992,7 @@ C_inline C_word C_i_fixnum_gcd(C_word x, C_word y)
 
 C_inline C_word C_fixnum_divide(C_word x, C_word y)
 {
-  if(y == C_fix(0)) C_div_by_zero_error("fx/");
+  if(y == C_fix(0)) C_div_by_zero_error(C_text("fx/"));
   return C_u_fixnum_divide(x, y);
 }
 
@@ -3004,7 +3000,7 @@ C_inline C_word C_fixnum_divide(C_word x, C_word y)
 C_inline C_word C_fixnum_modulo(C_word x, C_word y)
 {
   if(y == C_fix(0)) {
-C_div_by_zero_error("fxmod");
+C_div_by_zero_error(C_text("fxmod"));
   } else {
 y = C_unfix(y);
 x = C_unfix(x) % y;
@@ -3020,7 +3016,7 @@ C_inline C_word
 C_a_i_fixnum_quotient_checked(C_word **ptr, int c, C_word x, C_word y)
 {
   if (y == C_fix(0)) {
-C_div_by_zero_error("fx/");
+C_div_by_zero_error(C_text("fx/"));
   } else if (x == C_fix(C_MOST_NEGATIVE_FIXNUM) && y == C_fix(-1)) {
 return C_bignum1(ptr, 0, -C_MOST_NEGATIVE_FIXNUM); /* Special case */
   } else {
@@ -3031,7 +3027,7 @@ C_a_i_fixnum_quotient_checked(C_word **ptr, int c, C_word x, C_word y)
 C_inline C_word C_i_fixnum_remainder_checked(C_word x, C_word y)
 {
   if (y == C_fix(0)) {
-C_div_by_zero_error("fxrem");
+C_div_by_zero_error(C_text("fxrem"));
   } else {
 x = C_unfix(x);
 y = C_unfix(y);
@@ -3068,7 +3064,7 @@ C_inline C_word C_s_a_u_i_integer_abs(C_word **ptr, C_word n, C_word x)
 C_inline C_word C_i_fixnum_bit_setp(C_word n, C_word i)
 {
 if (i & C_INT_SIGN_BIT) {
-  C_not_an_uinteger_error("bit-set?", i);
+  C_not_an_uinteger_error(C_tex