Errors when compiling the latest version

19 views
Skip to first unread message

Jeff Lanzarotta

unread,
Sep 12, 2007, 9:44:24 AM9/12/07
to Vim Developer Mailing List
I am getting the following error, when I attempt to compile the latest version of Vim from the subversion repository:


C:\vim\vim7\src>bmake -f Make_bc5.mak
MAKE Version 5.2  Copyright (c) 1987, 2000 Borland
Compiling WIN32 gvim.exe , with: GUI MBYTE IME(dynamic) GETTEXT ICONV CSCOPE NET
BEANS cpu=-3 Align=-a4
A subdirectory or file WIN32 already exists.
A subdirectory or file WIN32\gobj already exists.
        copy /y MAKE0004.@@@ WIN32\gobj\bcc.cfg
        1 file(s) copied.
        C:\Borland\BCC55\BIN\Bcc32 +WIN32\gobj\bcc.cfg -c -nWIN32\gobj\ .\if_csc
ope.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
.\if_cscope.c:
Error E2451 .\if_cscope.c 912: Undefined symbol 'intptr_t' in function cs_create
_connection
Error E2121 .\if_cscope.c 912: Function call missing ) in function cs_create_con
nection
Error E2121 .\if_cscope.c 915: Function call missing ) in function cs_create_con
nection
*** 3 errors in Compile ***

Any ideas?


-Jeff

Nico Weber

unread,
Sep 12, 2007, 9:48:08 AM9/12/07
to vim...@googlegroups.com
> Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
> .\if_cscope.c:
> Error E2451 .\if_cscope.c 912: Undefined symbol 'intptr_t' in
> function cs_create
> _connection
> Error E2121 .\if_cscope.c 912: Function call missing ) in function
> cs_create_con
> nection
> Error E2121 .\if_cscope.c 915: Function call missing ) in function
> cs_create_con
> nection
> *** 3 errors in Compile ***
>
> Any ideas?

Does it help if you add

typedef long intptr_t

somewhere at the top of the file if_cscope.c (say, directly after the
#include "vim.h" line)?


Jeff Lanzarotta

unread,
Sep 12, 2007, 10:10:16 AM9/12/07
to vim...@googlegroups.com
I was thinking the same thing but I just wanted to let someone know there were errors...

After making the change, everything compiled just fine.

For some reason when I updated my version from the repository, if_cscope.c was changed to have these errors...?????

Nico Weber

unread,
Sep 12, 2007, 10:27:52 AM9/12/07
to vim...@googlegroups.com
> I was thinking the same thing but I just wanted to let someone know
> there were errors...
>
> After making the change, everything compiled just fine.
>
> For some reason when I updated my version from the repository,
> if_cscope.c was changed to have these errors...?????

Running

svn log if_cscope.c
svn diff -r 509:510 if_cscope.c

suggests that this was broken with patch 7.1.100 (which is revision
510). How is _open_osfhandle() defined by the borland libs? In which
header? There's an `#ifdef __BORLANDC__ /* stuff*/ #endif` block
missing that fixes this, let's see what the cleanest fix is...

Nico

Jeff Lanzarotta

unread,
Sep 12, 2007, 10:52:12 AM9/12/07
to vim...@googlegroups.com
_open_osfhandle() is defined in io.h as:

io.h:int  _RTLENTRY  _EXPFUNC _open_osfhandle(long __osfhandle, int __oflag);

Jeff Lanzarotta

unread,
Sep 12, 2007, 10:58:11 AM9/12/07
to vim...@googlegroups.com
I am not sure if this is the best place to do this, but I did:

Index: if_cscope.h

===================================================================

--- if_cscope.h    (revision 513)

+++ if_cscope.h    (working copy)

@@ -93,6 +93,9 @@

     Print
 } mcmd_e;
 
+#ifdef __BORLANDC__
+    typedef long intptr_t;
+#endif
 
#endif    /* FEAT_CSCOPE */

Nico Weber

unread,
Sep 12, 2007, 11:02:19 AM9/12/07
to vim...@googlegroups.com, mike.w...@globalgraphics.com
Mike, this is your patch. Do you think Jeff's fix looks ok?

Bram Moolenaar

unread,
Sep 12, 2007, 3:23:17 PM9/12/07
to Jeff Lanzarotta, vim...@googlegroups.com

Jeff Lanzarotta wrote:

> I am not sure if this is the best place to do this, but I did:
>
> Index: if_cscope.h
>
> ===================================================================
>
> --- if_cscope.h (revision 513)
>
> +++ if_cscope.h (working copy)
>
> @@ -93,6 +93,9 @@
>
> Print
> } mcmd_e;
>
> +#ifdef __BORLANDC__
> + typedef long intptr_t;
> +#endif
>
> #endif /* FEAT_CSCOPE */

Using Google Code Search I found a good hint in the cmake sources. Try
this patch:

*** ../vim-7.1.100/src/if_cscope.c Thu Sep 6 17:38:06 2007
--- src/if_cscope.c Wed Sep 12 20:32:17 2007
***************
*** 726,731 ****
--- 726,740 ----
HANDLE stdin_rd, stdout_rd;
HANDLE stdout_wr, stdin_wr;
BOOL created;
+ # ifdef __BORLANDC__
+ # define OPEN_OH_ARGTYPE long
+ # else
+ # if (_MSC_VER >= 1300)
+ # define OPEN_OH_ARGTYPE intptr_t
+ # else
+ # define OPEN_OH_ARGTYPE long
+ # endif
+ # endif
#endif

#if defined(UNIX)
***************
*** 909,918 ****
CloseHandle(pi.hThread);

/* TODO - tidy up after failure to create files on pipe handles. */
! if (((fd = _open_osfhandle((intptr_t)stdin_wr, _O_TEXT|_O_APPEND)) < 0)
|| ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL))
PERROR(_("cs_create_connection: fdopen for to_fp failed"));
! if (((fd = _open_osfhandle((intptr_t)stdout_rd, _O_TEXT|_O_RDONLY)) < 0)
|| ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL))
PERROR(_("cs_create_connection: fdopen for fr_fp failed"));

--- 918,929 ----
CloseHandle(pi.hThread);

/* TODO - tidy up after failure to create files on pipe handles. */
! if (((fd = _open_osfhandle((OPEN_OH_ARGTYPE)stdin_wr,
! _O_TEXT|_O_APPEND)) < 0)
|| ((csinfo[i].to_fp = _fdopen(fd, "w")) == NULL))
PERROR(_("cs_create_connection: fdopen for to_fp failed"));
! if (((fd = _open_osfhandle((OPEN_OH_ARGTYPE)stdout_rd,
! _O_TEXT|_O_RDONLY)) < 0)
|| ((csinfo[i].fr_fp = _fdopen(fd, "r")) == NULL))
PERROR(_("cs_create_connection: fdopen for fr_fp failed"));


--
A computer programmer is a device for turning requirements into
undocumented features. It runs on cola, pizza and Dilbert cartoons.
Bram Moolenaar

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Jeff Lanzarotta

unread,
Sep 13, 2007, 8:53:09 AM9/13/07
to vim...@googlegroups.com
I have never patched a source file before, but when I try this one, I get:


patching file if_cscope.c
patch: **** Overdue `---' at line 36; check line numbers at line 22


Any ideas?

Bram Moolenaar

unread,
Sep 13, 2007, 9:42:40 AM9/13/07
to Jeff Lanzarotta, vim...@googlegroups.com

Jeff Lanzarotta wrote:

> I have never patched a source file before, but when I try this one, I get:
>
>
> patching file if_cscope.c
> patch: **** Overdue `---' at line 36; check line numbers at line 22
>
>
> Any ideas?

It appears your e-mail system changed the white space in the message.
You can find the original message in Google groups. Here is a link that
might work:
http://groups.google.com/group/vim_dev/msg/d40704f8cb6a789c?dmode=source&output=gplain


--
WOMAN: I didn't know we had a king. I thought we were an autonomous
collective.
DENNIS: You're fooling yourself. We're living in a dictatorship. A
self-perpetuating autocracy in which the working classes--
WOMAN: Oh there you go, bringing class into it again.
DENNIS: That's what it's all about if only people would--
The Quest for the Holy Grail (Monty Python)

Jeff Lanzarotta

unread,
Sep 13, 2007, 10:29:51 AM9/13/07
to vim...@googlegroups.com
OK, that patch worked just fine after taking it from the original. After compiling, everything seems to work for me...

Will someone make this patch "official"?

Mike Williams

unread,
Sep 17, 2007, 9:56:47 AM9/17/07
to vim...@googlegroups.com, Jeff Lanzarotta

Better late then never - I was away last week. I noted in my original
patch I hadn't tested with BorlandC. This looks like the one to go with
- oh, I see we have. Fine by me.

TTFN

Mike
--
What's brown and sticky? A stick!

Reply all
Reply to author
Forward
0 new messages