This commit is contained in:
hyung-hwan 2008-06-07 04:19:57 +00:00
parent efdf40e95b
commit d1ba624139
10 changed files with 38 additions and 76 deletions

View File

@ -105,10 +105,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void ase_assert_abort (void); void ase_assert_failed (
void ase_assert_puts (const ase_char_t* str);
/*void ase_assert_printf (const ase_char_t* fmt, ...);*/
int ase_assert_failed (
const ase_char_t* expr, const ase_char_t* desc, const ase_char_t* expr, const ase_char_t* desc,
const ase_char_t* file, ase_size_t line); const ase_char_t* file, ase_size_t line);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/* /*
* $Id: ctype.h 131 2008-03-17 08:57:23Z baconevi $ * $Id: ctype.h 183 2008-06-03 08:18:55Z baconevi $
*/ */
#ifndef _ASE_UTL_CTYPE_H_ #ifndef _ASE_UTL_CTYPE_H_

View File

@ -1,5 +1,5 @@
/* /*
* $Id: getopt.h 137 2008-03-17 12:35:02Z baconevi $ * $Id: getopt.h 183 2008-06-03 08:18:55Z baconevi $
* *
* {License} * {License}
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: http.h 132 2008-03-17 10:27:02Z baconevi $ * $Id: http.h 183 2008-06-03 08:18:55Z baconevi $
* *
* {License} * {License}
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: main.h 132 2008-03-17 10:27:02Z baconevi $ * $Id: main.h 183 2008-06-03 08:18:55Z baconevi $
* *
* {License} * {License}
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* $Id: stdio.h 148 2008-03-18 08:26:52Z baconevi $ * $Id: stdio.h 183 2008-06-03 08:18:55Z baconevi $
* *
* {License} * {License}
*/ */

View File

@ -4,8 +4,8 @@
objects = mem.obj,str_bas.obj,str_cnv.obj,str_dyn.obj,map.obj,rex.obj,misc.obj objects = mem.obj,str_bas.obj,str_cnv.obj,str_dyn.obj,map.obj,rex.obj,misc.obj
CFLAGS = /include="../.." CFLAGS = /include="../../inc"
#CFLAGS = /pointer_size=long /include="../.." #CFLAGS = /pointer_size=long /include="../../inc"
LIBRFLAGS = LIBRFLAGS =
asecmn.olb : $(objects) asecmn.olb : $(objects)

View File

@ -1,5 +1,5 @@
/* /*
* $Id: misc.c 116 2008-03-03 11:15:37Z baconevi $ * $Id: misc.c 191 2008-06-06 10:19:57Z baconevi $
* *
* {License} * {License}
*/ */
@ -9,31 +9,3 @@
#define Library #define Library
#endif #endif
#include <ase/cmn/types.h>
#include <ase/cmn/macros.h>
#ifndef NDEBUG
int ase_assert_failed (
const ase_char_t* expr, const ase_char_t* desc,
const ase_char_t* file, ase_size_t line)
{
if (desc == ASE_NULL)
{
ase_assert_printf (
ASE_T("ASSERTION FAILURE AT FILE %s LINE %lu\n%s\n"),
file, (unsigned long)line, expr);
}
else
{
ase_assert_printf (
ASE_T("ASSERTION FAILURE AT FILE %s LINE %lu\n%s\n\nDESCRIPTION:\n%s\n"),
file, (unsigned long)line, expr, desc);
}
ase_assert_abort ();
return 0;
}
#endif

View File

@ -1,48 +1,38 @@
/* /*
* $Id$ * $Id$
*
* {License}
*/ */
#include <ase/cmn/types.h>
#include <ase/cmn/macros.h>
#ifndef NDEBUG #ifndef NDEBUG
#include <ase/cmn/stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#ifdef _WIN32 int ase_assert_failed (
#include <windows.h> const ase_char_t* expr, const ase_char_t* desc,
#include <tchar.h> const ase_char_t* file, ase_size_t line)
#endif
void ase_assert_abort (void)
{ {
if (desc == ASE_NULL)
{
ase_fprintf (
ASE_STDERR,
ASE_T("ASSERTION FAILURE AT FILE %s LINE %lu\n%s\n"),
file, (unsigned long)line, expr);
}
else
{
ase_fprintf (
ASE_STDERR,
ASE_T("ASSERTION FAILURE AT FILE %s LINE %lu\n%s\n\nDESCRIPTION:\n%s\n"),
file, (unsigned long)line, expr, desc);
}
abort (); abort ();
return 0;
} }
void ase_assert_printf (const ase_char_t* fmt, ...)
{
va_list ap;
#ifdef _WIN32
int n;
ase_char_t buf[1024];
#endif #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

View File

@ -4,16 +4,19 @@
NAME = aseutl NAME = aseutl
TOP_DIR = @abs_top_builddir@
CC = @CC@ CC = @CC@
AR = @AR@ AR = @AR@
MAKE = @MAKE@ MAKE = @MAKE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
CFLAGS = @CFLAGS@ -I@abs_top_builddir@/.. CFLAGS = @CFLAGS@ -I$(TOP_DIR)/inc
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
MODE = @BUILDMODE@ MODE = @BUILDMODE@
OUT_DIR = ../$(MODE)/lib
OUT_DIR = $(TOP_DIR)/out/$(MODE)/lib
OUT_FILE = $(OUT_DIR)/lib$(NAME).a OUT_FILE = $(OUT_DIR)/lib$(NAME).a
TMP_DIR = $(MODE) TMP_DIR = $(MODE)