#8 Diffs for "ecl --with-cxx" on MinGW

open
nobody
None
5
2012-08-15
2010-06-11
Erik Winkels
No

Hi, I had to patch the following to get ECL 10.4.1 to compile on MinGW. I noticed by browsing CVS that these issues had not been fixed there.

I have no in depth knowledge of what I changed, I just fixed what the compiler complained about and I have tested these fixes by starting a Slime / Swank server and connecting to it from Emacs for both an ECL compiled --with-cxx and an ECL compiled without it. (Only on Windows though.)

=== g++ version ===
$ g++ --version
g++.exe (TDM-2 mingw32) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
===

=== gmp-h.in ===
--- /c/Software/ogre-build-environment/ecl-git/src/gmp/gmp-h.in 2010-04-07 20:46:46 +0200
+++ /c/Software/ogre-build-environment/ecl-10.4.1/src/gmp/gmp-h.in 2010-06-11 11:17:15 +0200
@@ -23,6 +23,7 @@
#ifndef GMP_H

#if defined (__cplusplus)
+#include <cstdio> / for std::file (aerique) /
#include <iosfwd> / for std::istream, std::ostream, std::string /
#endif
===

=== sockets.lisp ===
--- /c/Software/ogre-build-environment/ecl-git/contrib/sockets/sockets.lisp 2010-06-11 14:06:42 +0200
+++ /c/Software/ogre-build-environment/ecl-10.4.1/contrib/sockets/sockets.lisp2010-06-11 20:08:10 +0200
@@ -228,7 +228,7 @@
vector[2] = fixint(ecl_aref(#0,2));
vector[3] = fixint(ecl_aref(#0,3));
ecl_disable_interrupts();
- hostent = gethostbyaddr(vector,4,AF_INET);
+ hostent = gethostbyaddr((const char*)vector,4,AF_INET);
ecl_enable_interrupts();

    if (hostent != NULL) {

@@ -481,7 +481,7 @@
ssize_t len;

     ecl_disable_interrupts();
  • len = recvfrom(#0, safe_buffer_pointer(#1, #2),
  • len = recvfrom(#0, (char*)safe_buffer_pointer(#1, #2),
    #2, flags, NULL,NULL);
    ecl_enable_interrupts();
    if (len >= 0) {
    @@ -745,7 +745,7 @@

    ecl_disable_interrupts();
    fill_inet_sockaddr(&sockaddr, #3, #4, #5, #6, #7);
    
    • len = sendto(#0, safe_buffer_pointer(#1,#2),
    • len = sendto(#0, (const char)safe_buffer_pointer(#1,#2),
      #2, flags,(struct sockaddr
      )&sockaddr,
      sizeof(struct sockaddr_in));
      ecl_enable_interrupts();
      @@ -769,7 +769,7 @@
      cl_type type = type_of(#1);
      ssize_t len;
      ecl_disable_interrupts();
    • len = send(#0, safe_buffer_pointer(#1,#2), #2, flags);
    • len = send(#0, (const char*)safe_buffer_pointer(#1,#2), #2, flags);
      ecl_enable_interrupts();
      @(return) = len;
      }
      @@ -1007,7 +1007,7 @@
      if (hnd == INVALID_HANDLE_VALUE)
      @(return) = -1;
      else
    • @(return) = _open_osfhandle(hnd, O_RDWR);
    • @(return) = _open_osfhandle((long int)hnd, O_RDWR);
      }")))
      (when (= hnd -1)
      (socket-error "CreateNamedPipe"))
      @@ -1019,7 +1019,7 @@
      (afd (c-inline (fd) (:int) :int
      "
      {
    • HANDLE hnd = _get_osfhandle(#0), dupHnd;
    • HANDLE hnd = (void*)_get_osfhandle(#0), dupHnd;
      ecl_disable_interrupts();
      if (ConnectNamedPipe(hnd, NULL) != 0 || GetLastError() == ERROR_PIPE_CONNECTED) {
      @(return) = #0;
      @@ -1064,7 +1064,7 @@
      if (hnd == INVALID_HANDLE_VALUE)
      @(return) = -1;
      else
    • @(return) = _open_osfhandle(hnd, O_RDWR);
    • @(return) = _open_osfhandle((long int)hnd, O_RDWR);
      ecl_enable_interrupts();
      }")))
      (socket-error "connect")
      @@ -1081,7 +1081,7 @@
      {
      DWORD mode = PIPE_READMODE_BYTE | (#1 == Ct ? PIPE_NOWAIT : PIPE_WAIT);
      ecl_disable_interrupts();
    • @(return) = SetNamedPipeHandleState(_get_osfhandle(#0), &mode, NULL, NULL);
    • @(return) = SetNamedPipeHandleState((void*)_get_osfhandle(#0), &mode, NULL, NULL);
      ecl_enable_interrupts();
      }"
      :one-liner nil))
      @@ -1095,9 +1095,9 @@
      {
      DWORD flags;
      ecl_disable_interrupts();
    • if (!GetNamedPipeInfo(_get_osfhandle(#0), &flags, NULL, NULL, NULL))
    • if (!GetNamedPipeInfo((void*)_get_osfhandle(#0), &flags, NULL, NULL, NULL))
      @(return) = Cnil;
    • if (flags == PIPE_CLIENT_END || DisconnectNamedPipe(_get_osfhandle(#0)))
    • if (flags == PIPE_CLIENT_END || DisconnectNamedPipe((void*)_get_osfhandle(#0)))
      @(return) = Ct;
      else
      @(return) = Cnil;
      @@ -1433,7 +1433,7 @@
      socklen_t socklen = sizeof(int);

      ecl_disable_interrupts();
      - ret = getsockopt(#0,#1,#2,&sockopt,&socklen);
      + ret = getsockopt(#0,#1,#2,(char*)&sockopt,&socklen);
      ecl_enable_interrupts();

      @(return) = (ret == 0) ? ecl_make_integer(sockopt) : Cnil;
      @@ -1449,7 +1449,7 @@
      socklen_t socklen = sizeof(int);

      ecl_disable_interrupts();
      - ret = getsockopt(#0,#1,#2,&sockopt,&socklen);
      + ret = getsockopt(#0,#1,#2,(char*)&sockopt,&socklen);
      ecl_enable_interrupts();

      @(return) = (ret == 0) ? ecl_make_integer(sockopt) : Cnil;
      @@ -1489,7 +1489,7 @@
      int ret;

      ecl_disable_interrupts();
      - ret = getsockopt(#0,#1,#2,&sockopt,&socklen);
      + ret = getsockopt(#0,#1,#2,(char*)&sockopt,&socklen);
      ecl_enable_interrupts();

      @(return) = (ret == 0) ? ecl_make_integer((sockopt.l_onoff != 0) ? sockopt.l_linger : 0) : Cnil;
      @@ -1505,7 +1505,7 @@
      int ret;

      ecl_disable_interrupts();
      - ret = setsockopt(#0,#1,#2,&sockopt,sizeof(int));
      + ret = setsockopt(#0,#1,#2,(const char*)&sockopt,sizeof(int));
      ecl_enable_interrupts();

      @(return) = (ret == 0) ? Ct : Cnil;
      @@ -1521,7 +1521,7 @@
      int ret;

      ecl_disable_interrupts();
      - ret = setsockopt(#0,#1,#2,&sockopt,sizeof(int));
      + ret = setsockopt(#0,#1,#2,(const char*)&sockopt,sizeof(int));
      ecl_enable_interrupts();

      @(return) = (ret == 0) ? Ct : Cnil;
      @@ -1567,7 +1567,7 @@
      }

      ecl_disable_interrupts();
      - ret = setsockopt(#0,#1,#2,&sockopt,sizeof(struct linger));
      + ret = setsockopt(#0,#1,#2,(const char*)&sockopt,sizeof(struct linger));
      ecl_enable_interrupts();

      @(return) = (ret == 0) ? Ct : Cnil;

Discussion

  • Unfortunately Sourceforge has scrambled your patch to a point that is totally useless. Do you have a text copy around?

     


Anonymous


Cancel   Add attachments