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)?
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
> 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 ///
> 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)
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!