diff --git a/ase/lsp/lsp.c b/ase/lsp/lsp.c index 35503ed4..5a8475bd 100644 --- a/ase/lsp/lsp.c +++ b/ase/lsp/lsp.c @@ -1,5 +1,5 @@ /* - * $Id: lsp.c,v 1.10 2006-10-26 09:31:28 bacon Exp $ + * $Id: lsp.c,v 1.11 2006-10-28 16:08:34 bacon Exp $ */ #if defined(__BORLANDC__) @@ -38,6 +38,7 @@ ase_lsp_t* ase_lsp_open ( syscas->to_lower == ASE_NULL) return ASE_NULL; if (syscas->sprintf == ASE_NULL || + syscas->aprintf == ASE_NULL || syscas->dprintf == ASE_NULL || syscas->abort == ASE_NULL) return ASE_NULL; diff --git a/ase/lsp/lsp.h b/ase/lsp/lsp.h index 188fafa3..62784257 100644 --- a/ase/lsp/lsp.h +++ b/ase/lsp/lsp.h @@ -1,5 +1,5 @@ /* - * $Id: lsp.h,v 1.27 2006-10-26 09:31:28 bacon Exp $ + * $Id: lsp.h,v 1.28 2006-10-28 16:08:34 bacon Exp $ */ #ifndef _ASE_LSP_LSP_H_ @@ -42,6 +42,7 @@ struct ase_lsp_syscas_t void* (*memset) (void* dst, int val, ase_size_t n); int (*sprintf) (ase_char_t* buf, ase_size_t size, ase_char_t* fmt, ...); + int (*aprintf) (ase_char_t* fmt, ...); int (*dprintf) (ase_char_t* fmt, ...); void (*abort) (void); diff --git a/ase/lsp/misc.c b/ase/lsp/misc.c index 4eaed086..fddf98fa 100644 --- a/ase/lsp/misc.c +++ b/ase/lsp/misc.c @@ -1,5 +1,5 @@ /* - * $Id: misc.c,v 1.3 2006-10-26 09:31:28 bacon Exp $ + * $Id: misc.c,v 1.4 2006-10-28 16:08:34 bacon Exp $ */ #include @@ -753,7 +753,7 @@ ase_char_t* ase_lsp_strxnstr ( int ase_lsp_assertfail (ase_lsp_t* lsp, const ase_char_t* expr, const ase_char_t* file, int line) { - lsp->syscas.dprintf ( + lsp->syscas.aprintf ( ASE_T("ASSERTION FAILURE AT FILE %s, LINE %d\n%s\n"), file, line, expr); lsp->syscas.abort (); diff --git a/ase/test/lsp/lsp.c b/ase/test/lsp/lsp.c index 3753eaef..63d2a3e8 100644 --- a/ase/test/lsp/lsp.c +++ b/ase/test/lsp/lsp.c @@ -17,7 +17,8 @@ static xp_ssize_t get_input (int cmd, void* arg, xp_char_t* data, xp_size_t size { xp_ssize_t n; - switch (cmd) { + switch (cmd) + { case ASE_LSP_IO_OPEN: case ASE_LSP_IO_CLOSE: return 0; @@ -36,7 +37,8 @@ static xp_ssize_t get_input (int cmd, void* arg, xp_char_t* data, xp_size_t size static xp_ssize_t put_output (int cmd, void* arg, xp_char_t* data, xp_size_t size) { - switch (cmd) { + switch (cmd) + { case ASE_LSP_IO_OPEN: case ASE_LSP_IO_CLOSE: return 0; @@ -53,7 +55,8 @@ int to_int (const xp_char_t* str) { int r = 0; - while (*str != XP_CHAR('\0')) { + while (*str != XP_CHAR('\0')) + { if (!xp_isdigit(*str)) break; r = r * 10 + (*str - XP_CHAR('0')); str++; @@ -157,7 +160,7 @@ static void __lsp_free (void* ptr, void* custom_data) #endif } -static int __dprintf (const xp_char_t* fmt, ...) +static int __aprintf (const xp_char_t* fmt, ...) { int n; va_list ap; @@ -181,6 +184,21 @@ static int __dprintf (const xp_char_t* fmt, ...) return n; } +static int __dprintf (const ase_char_t* fmt, ...) +{ + int n; + va_list ap; + va_start (ap, fmt); + +#ifdef _WIN32 + n = _vftprintf (stderr, fmt, ap); +#else + n = xp_vfprintf (stderr, fmt, ap); +#endif + + va_end (ap); + return n; +} int __main (int argc, xp_char_t* argv[]) { @@ -247,6 +265,7 @@ int __main (int argc, xp_char_t* argv[]) syscas.memcpy = memcpy; syscas.memset = memset; syscas.sprintf = xp_sprintf; + syscas.aprintf = __aprintf; syscas.dprintf = __dprintf; syscas.abort = abort; diff --git a/ase/test/lsp/makefile.bcc b/ase/test/lsp/makefile.bcc new file mode 100644 index 00000000..4f5c63cd --- /dev/null +++ b/ase/test/lsp/makefile.bcc @@ -0,0 +1,19 @@ +CC = bcc32 +LD = ilink32 +CFLAGS = -I..\..\.. -I$(XPKIT) +LDFLAGS = -L..\..\lsp -L"c:\program files\borland\bds\4.0\lib" -L$(XPKIT)\xp\bas +LIBS = import32.lib cw32mt.lib aselsp.lib xpbas.lib +STARTUP = c0x32w.obj + +all: lsp + +lsp: lsp.obj + $(LD) $(LDFLAGS) $(STARTUP) lsp.obj,lsp.exe,,$(LIBS),, + +clean: + del $(OBJS) *.obj $(OUT) + +.SUFFIXES: .c .obj +.c.obj: + $(CC) $(CFLAGS) -c $< +