diff --git a/ase/lib/utl/assert.c b/ase/lib/utl/assert.c new file mode 100644 index 00000000..b2bf98d2 --- /dev/null +++ b/ase/lib/utl/assert.c @@ -0,0 +1,48 @@ +/* + * $Id$ + * + * {License} + */ + +#ifndef NDEBUG + +#include +#include +#include + +#ifdef _WIN32 +#include +#include +#endif + +void ase_assert_abort (void) +{ + abort (); +} + +void ase_assert_printf (const ase_char_t* fmt, ...) +{ + va_list ap; +#ifdef _WIN32 + int n; + ase_char_t buf[1024]; +#endif + + va_start (ap, fmt); +#if defined(_WIN32) + n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap); + if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0'); + + #if defined(_MSC_VER) && (_MSC_VER<1400) + MessageBox (NULL, buf, + ASE_T("Assertion Failure"), MB_OK|MB_ICONERROR); + #else + MessageBox (NULL, buf, + ASE_T("\uB2DD\uAE30\uB9AC \uC870\uB610"), MB_OK|MB_ICONERROR); + #endif +#else + ase_vprintf (fmt, ap); +#endif + va_end (ap); +} +#endif diff --git a/ase/lib/utl/http.c b/ase/lib/utl/http.c index 31fd54e7..c16c7d15 100644 --- a/ase/lib/utl/http.c +++ b/ase/lib/utl/http.c @@ -1,5 +1,7 @@ /* - * $Id: http.c 116 2008-03-03 11:15:37Z baconevi $ + * $Id: http.c 186 2008-06-03 09:00:14Z baconevi $ + * + * {License} */ #include diff --git a/ase/lib/utl/makefile.in b/ase/lib/utl/makefile.in index 8f915ee2..68ca05c8 100644 --- a/ase/lib/utl/makefile.in +++ b/ase/lib/utl/makefile.in @@ -23,7 +23,8 @@ OBJ_FILES = \ $(TMP_DIR)/ctype.o \ $(TMP_DIR)/stdio.o \ $(TMP_DIR)/http.o \ - $(TMP_DIR)/getopt.o + $(TMP_DIR)/getopt.o \ + $(TMP_DIR)/assert.c lib: $(OUT_FILE) @@ -46,6 +47,9 @@ $(TMP_DIR)/http.o: http.c $(TMP_DIR)/getopt.o: getopt.c $(CC) $(CFLAGS) -o $@ -c getopt.c +$(TMP_DIR)/assert.o: assert.c + $(CC) $(CFLAGS) -o $@ -c assert.c + $(OUT_DIR): mkdir -p $(OUT_DIR)