Compare commits

..

5 Commits

Author SHA1 Message Date
Bram Moolenaar
2d6db76d97 updated for version 7.2-248 2009-09-11 10:49:58 +00:00
Bram Moolenaar
e484c94514 updated for version 7.2-247 2009-09-11 10:21:41 +00:00
Bram Moolenaar
8ae39d8432 updated for version 7.2-246 2009-09-11 09:30:34 +00:00
Bram Moolenaar
b5cdf2eab3 updated for version 7.2-245 2009-07-29 16:25:31 +00:00
Bram Moolenaar
32b485f2b0 updated for version 7.2-244 2009-07-29 16:06:27 +00:00
7 changed files with 122 additions and 27 deletions

View File

@@ -481,7 +481,8 @@ bit of code) was adapted from the cscope interface in nvi. Please report
any problems, suggestions, patches, et al., you have for the usage of
cscope within Vim to him.
*cscope-win32*
For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html
For a cscope version for Win32 see:
http://code.google.com/p/cscope-win32/
Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
him if you have Win32-specific issues.

View File

@@ -212,13 +212,34 @@ ifndef MZSCHEME_VER
MZSCHEME_VER = 209_000
endif
ifndef MZSCHEME_PRECISE_GC
MZSCHEME_PRECISE_GC=no
endif
# for version 4.x we need to generate byte-code for Scheme base
ifndef MZSCHEME_GENERATE_BASE
MZSCHEME_GENERATE_BASE=no
endif
ifeq (yes, $(DYNAMIC_MZSCHEME))
DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
else
ifndef MZSCHEME_DLLS
MZSCHEME_DLLS = $(MZSCHEME)
endif
EXTRA_LIBS += -L$(MZSCHEME_DLLS) -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
ifeq (yes,$(MZSCHEME_PRECISE_GC))
MZSCHEME_LIB=-lmzsch$(MZSCHEME_VER)
else
MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
endif
EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB)
endif
ifeq (yes,$(MZSCHEME_GENERATE_BASE))
DEFINES += -DINCLUDE_MZSCHEME_BASE
MZ_EXTRA_DEP += mzscheme_base.c
endif
ifeq (yes,$(MZSCHEME_PRECISE_GC))
DEFINES += -DMZ_PRECISE_GC
endif
endif
@@ -472,6 +493,9 @@ clean:
-$(DEL) $(EXE) vimrun.exe install.exe uninstal.exe
ifdef PERL
-$(DEL) if_perl.c
endif
ifdef MZSCHEME
-$(DEL) mzscheme_base.c
endif
-$(DEL) pathdef.c
$(MAKE) -C xxd -f Make_cyg.mak clean
@@ -523,9 +547,15 @@ endif
$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
$(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
mzscheme_base.c:
$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
pathdef.c: $(INCL)
ifneq (sh.exe, $(SHELL))
@echo creating pathdef.c

View File

@@ -135,7 +135,7 @@ endif
ifndef MZSCHEME_DLLS
MZSCHEME_DLLS=$(MZSCHEME)
endif
MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS)
MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
endif
endif
@@ -562,6 +562,9 @@ clean:
-$(DEL) pathdef.c
ifdef PERL
-$(DEL) if_perl.c
endif
ifdef MZSCHEME
-$(DEL) mzscheme_base.c
endif
$(MAKE) -C GvimExt -f Make_ming.mak clean
$(MAKE) -C xxd -f Make_cyg.mak clean

View File

@@ -865,6 +865,7 @@ clean:
- if exist dimm_i.c del dimm_i.c
- if exist dimm.tlb del dimm.tlb
- if exist dosinst.exe del dosinst.exe
- if exist mzscheme_base.c del mzscheme_base.c
cd xxd
$(MAKE) /NOLOGO -f Make_mvc.mak clean
cd ..

View File

@@ -121,6 +121,8 @@ struct bw_info
char_u *bw_conv_buf; /* buffer for writing converted chars */
int bw_conv_buflen; /* size of bw_conv_buf */
int bw_conv_error; /* set for conversion error */
linenr_T bw_conv_error_lnum; /* first line with error or zero */
linenr_T bw_start_lnum; /* line number at start of buffer */
# ifdef USE_ICONV
iconv_t bw_iconv_fd; /* descriptor for iconv() or -1 */
# endif
@@ -132,7 +134,7 @@ static int buf_write_bytes __ARGS((struct bw_info *ip));
#ifdef FEAT_MBYTE
static linenr_T readfile_linenr __ARGS((linenr_T linecnt, char_u *p, char_u *endp));
static int ucs2bytes __ARGS((unsigned c, char_u **pp, int flags));
static int same_encoding __ARGS((char_u *a, char_u *b));
static int need_conversion __ARGS((char_u *fenc));
static int get_fio_flags __ARGS((char_u *ptr));
static char_u *check_for_bom __ARGS((char_u *p, long size, int *lenp, int flags));
static int make_bom __ARGS((char_u *buf, char_u *name));
@@ -1041,13 +1043,12 @@ retry:
}
/*
* Conversion is required when the encoding of the file is different
* from 'encoding' or 'encoding' is UTF-16, UCS-2 or UCS-4 (requires
* conversion to UTF-8).
* Conversion may be required when the encoding of the file is different
* from 'encoding' or 'encoding' is UTF-16, UCS-2 or UCS-4.
*/
fio_flags = 0;
converted = (*fenc != NUL && !same_encoding(p_enc, fenc));
if (converted || enc_unicode != 0)
converted = need_conversion(fenc);
if (converted)
{
/* "ucs-bom" means we need to check the first bytes of the file
@@ -2924,6 +2925,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
linenr_T lnum;
long nchars;
char_u *errmsg = NULL;
int errmsg_allocated = FALSE;
char_u *errnum = NULL;
char_u *buffer;
char_u smallbuf[SMBUFSIZE];
@@ -2987,6 +2989,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
/* must init bw_conv_buf and bw_iconv_fd before jumping to "fail" */
write_info.bw_conv_buf = NULL;
write_info.bw_conv_error = FALSE;
write_info.bw_conv_error_lnum = 0;
write_info.bw_restlen = 0;
# ifdef USE_ICONV
write_info.bw_iconv_fd = (iconv_t)-1;
@@ -3965,10 +3968,9 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
fenc = buf->b_p_fenc;
/*
* The file needs to be converted when 'fileencoding' is set and
* 'fileencoding' differs from 'encoding'.
* Check if the file needs to be converted.
*/
converted = (*fenc != NUL && !same_encoding(p_enc, fenc));
converted = need_conversion(fenc);
/*
* Check if UTF-8 to UCS-2/4 or Latin1 conversion needs to be done. Or
@@ -4243,6 +4245,7 @@ restore_backup:
nchars += write_info.bw_len;
}
}
write_info.bw_start_lnum = start;
#endif
write_info.bw_len = bufsize;
@@ -4278,6 +4281,9 @@ restore_backup:
nchars += bufsize;
s = buffer;
len = 0;
#ifdef FEAT_MBYTE
write_info.bw_start_lnum = lnum;
#endif
}
/* write failed or last line has no EOL: stop here */
if (end == 0
@@ -4474,7 +4480,17 @@ restore_backup:
{
#ifdef FEAT_MBYTE
if (write_info.bw_conv_error)
errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
{
if (write_info.bw_conv_error_lnum == 0)
errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
else
{
errmsg_allocated = TRUE;
errmsg = alloc(300);
vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"),
(long)write_info.bw_conv_error_lnum);
}
}
else
#endif
if (got_int)
@@ -4550,6 +4566,12 @@ restore_backup:
{
STRCAT(IObuff, _(" CONVERSION ERROR"));
c = TRUE;
if (write_info.bw_conv_error_lnum != 0)
{
int l = STRLEN(IObuff);
vim_snprintf((char *)IObuff + l, IOSIZE - l, _(" in line %ld;"),
(long)write_info.bw_conv_error_lnum);
}
}
else if (notconverted)
{
@@ -4746,6 +4768,8 @@ nofail:
}
STRCAT(IObuff, errmsg);
emsg(IObuff);
if (errmsg_allocated)
vim_free(errmsg);
retval = FAIL;
if (end == 0)
@@ -5105,7 +5129,13 @@ buf_write_bytes(ip)
c = buf[wlen];
}
ip->bw_conv_error |= ucs2bytes(c, &p, flags);
if (ucs2bytes(c, &p, flags) && !ip->bw_conv_error)
{
ip->bw_conv_error = TRUE;
ip->bw_conv_error_lnum = ip->bw_start_lnum;
}
if (c == NL)
++ip->bw_start_lnum;
}
if (flags & FIO_LATIN1)
len = (int)(p - buf);
@@ -5386,6 +5416,7 @@ buf_write_bytes(ip)
#ifdef FEAT_MBYTE
/*
* Convert a Unicode character to bytes.
* Return TRUE for an error, FALSE when it's OK.
*/
static int
ucs2bytes(c, pp, flags)
@@ -5469,20 +5500,37 @@ ucs2bytes(c, pp, flags)
}
/*
* Return TRUE if "a" and "b" are the same 'encoding'.
* Ignores difference between "ansi" and "latin1", "ucs-4" and "ucs-4be", etc.
* Return TRUE if file encoding "fenc" requires conversion from or to
* 'encoding'.
*/
static int
same_encoding(a, b)
char_u *a;
char_u *b;
need_conversion(fenc)
char_u *fenc;
{
int f;
int same_encoding;
int enc_flags;
int fenc_flags;
if (STRCMP(a, b) == 0)
return TRUE;
f = get_fio_flags(a);
return (f != 0 && get_fio_flags(b) == f);
if (*fenc == NUL || STRCMP(p_enc, fenc) == 0)
same_encoding = TRUE;
else
{
/* Ignore difference between "ansi" and "latin1", "ucs-4" and
* "ucs-4be", etc. */
enc_flags = get_fio_flags(p_enc);
fenc_flags = get_fio_flags(fenc);
same_encoding = (enc_flags != 0 && fenc_flags == enc_flags);
}
if (same_encoding)
{
/* Specified encoding matches with 'encoding'. This requires
* conversion when 'encoding' is Unicode but not UTF-8. */
return enc_unicode != 0;
}
/* Encodings differ. However, conversion is not needed when 'enc' is any
* Unicode encoding and the file is UTF-8. */
return !(enc_utf8 && fenc_flags == FIO_UTF8);
}
/*

View File

@@ -635,8 +635,10 @@ dynamic_mzscheme_end(void)
#endif /* DYNAMIC_MZSCHEME */
/* need to put it here for dynamic stuff to work */
#ifdef INCLUDE_MZSCHEME_BASE
#if defined(INCLUDE_MZSCHEME_BASE)
# include "mzscheme_base.c"
#elif MZSCHEME_VERSION_MAJOR >= 400
# error MzScheme 4.x must include mzscheme_base.c, for MinGW32 you need to define MZSCHEME_GENERATE_BASE=yes
#endif
/*
@@ -875,14 +877,14 @@ startup_mzscheme(void)
#ifdef INCLUDE_MZSCHEME_BASE
{
/*
* versions 4.x do not provide Scheme bindings by defaults
* versions 4.x do not provide Scheme bindings by default
* we need to add them explicitly
*/
Scheme_Object *scheme_base_symbol = NULL;
MZ_GC_DECL_REG(1);
MZ_GC_VAR_IN_REG(0, scheme_base_symbol);
MZ_GC_REG();
/* invoke function from generated and included base.c */
/* invoke function from generated and included mzscheme_base.c */
declare_modules(environment);
scheme_base_symbol = scheme_intern_symbol("scheme/base");
MZ_GC_CHECK();

View File

@@ -676,6 +676,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
248,
/**/
247,
/**/
246,
/**/
245,
/**/
244,
/**/
243,
/**/