ffi patch

Sigbjorn Finne sigbjorn_finne@hotmail.com
Wed, 7 Feb 2001 12:51:09 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0018_01C09104.A4B4E870
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

The FFI C code generator (enabled via :set +G) emits code
that's not ANSI C compliant (causes problems with MSVC
and 'gcc -pedantic') - attached is a patch that fixes this.

--sigbjorn


------=_NextPart_000_0018_01C09104.A4B4E870
Content-Type: application/octet-stream;
	name="ffi-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="ffi-patch"

*** ffi.c.~1~	Wed Dec 13 10:01:54 2000
--- ffi.c	Wed Feb  7 12:46:10 2001
***************
*** 81,88 ****
              "static void primControl Args((int));\n"
              "static void primControl(what)\n"
!             "int what; {\n"
!             "    switch (what) {\n"
!             "        case %d:\n", RESET
!             );
      for(xs=es; nonNull(xs); xs=tl(xs)) {
          Name n       = hd(xs);
--- 81,93 ----
              "static void primControl Args((int));\n"
              "static void primControl(what)\n"
!             "int what; {\n");
! 
!     if (nonNull(es)) {
!       fprintf(out,
! 	      "    switch (what) {\n"
!               "        case %d:\n", RESET
! 	      );
!     }
! 
      for(xs=es; nonNull(xs); xs=tl(xs)) {
          Name n       = hd(xs);
***************
*** 97,104 ****
          }
      }
!     fprintf(out,
!             "    }\n"
!             "}\n"
!             );
  
      /* Boilerplate initialization function */
--- 102,109 ----
          }
      }
!     if (nonNull(es)) {
!       fprintf(out,"    }\n");
!     }
!     fprintf(out, "}\n");
  
      /* Boilerplate initialization function */

------=_NextPart_000_0018_01C09104.A4B4E870--