chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to build chicken on windows (11) in the msys2 environment


From: tomasn
Subject: Re: Trying to build chicken on windows (11) in the msys2 environment
Date: Fri, 30 Aug 2024 14:26:53 +0000

Hello!

On 30.08.2024 11:42, felix.winkelmann@bevuta.com wrote:

Apparently the types don't match. If you change the casts in the macro
definitions
for C_u_i_execve and C_u_i_spawnvpe from "const char* const*" to "char *const*",
does the build succeed?


felix

With that advice and the following diff (I think)

--- posixwin-bak.c      2024-08-30 15:34:16.048878600 +0200
+++ posixwin.c  2024-08-30 15:51:09.140853000 +0200
@@ -181,12 +181,12 @@

 #define C_u_i_lstat(fn)     C_u_i_stat(fn)

-#define C_u_i_execvp(f,a) C_fix(execvp(C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a))) -#define C_u_i_execve(f,a,e) C_fix(execve(C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a), (const char *const *)C_c_pointer_vector_or_null(e))) +#define C_u_i_execvp(f,a) C_fix(execvp(C_c_string(f), (char *const *)C_c_pointer_vector_or_null(a))) +#define C_u_i_execve(f,a,e) C_fix(execve(C_c_string(f), (char *const *)C_c_pointer_vector_or_null(a), (char *const *)C_c_pointer_vector_or_null(e)))

 /* MS replacement for the fork-exec pair */
-#define C_u_i_spawnvp(m,f,a) C_fix(spawnvp(C_unfix(m), C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a))) -#define C_u_i_spawnvpe(m,f,a,e) C_fix(spawnvpe(C_unfix(m), C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a), (const char *const *)C_c_pointer_vector_or_null(e))) +#define C_u_i_spawnvp(m,f,a) C_fix(spawnvp(C_unfix(m), C_c_string(f), (char *const *)C_c_pointer_vector_or_null(a))) +#define C_u_i_spawnvpe(m,f,a,e) C_fix(spawnvpe(C_unfix(m), C_c_string(f), (char *const *)C_c_pointer_vector_or_null(a), (char *const *)C_c_pointer_vector_or_null(e)))

#define C_open(fn, fl, m) C_fix(open(C_c_string(fn), C_unfix(fl), C_unfix(m))) #define C_read(fd, b, n) C_fix(read(C_unfix(fd), C_data_pointer(b), C_unfix(n)))

the build runs through with the following warnings:

gcc -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -c -Os -DC_BUILDING_LIBCHICKEN library.c -o library-static.o -I. -I./
In file included from chicken.h:131,
                 from library.c:9:
library.c:157:15: warning: '__p__environ' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
  157 | extern char **environ;
      |               ^~~~~~~


and

gcc -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -c -Os -DPIC -DC_BUILDING_LIBCHICKEN library.c -o library.o -I. -I./
In file included from chicken.h:131,
                 from library.c:9:
library.c:157:15: warning: '__p__environ' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
  157 | extern char **environ;

I can now say (in the build directory)

$ ./csi -version
CHICKEN
(c) 2008-2022, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.4.0 (rev 1a1d1495)
mingw32-windows-gnu-x86-64 [ 64bit dload ptables ]

No further testing so far...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]