Recovered from cvs revision 2007-05-21 04:15:00

This commit is contained in:
hyung-hwan 2007-05-23 01:01:00 +00:00
parent f429b0faea
commit 2a75f49e57
2 changed files with 19 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: StdAwk.cpp,v 1.17 2007/05/19 16:45:27 bacon Exp $ * $Id: StdAwk.cpp,v 1.19 2007/05/20 16:21:09 bacon Exp $
*/ */
#include <ase/awk/StdAwk.hpp> #include <ase/awk/StdAwk.hpp>
@ -124,16 +124,16 @@ namespace ASE
char_t buf[128]; char_t buf[128];
struct tm* tm; struct tm* tm;
#ifdef _WIN32 #ifdef _WIN32
tm = localtime (&t); tm = ::localtime (&t);
#else #else
struct tm tmb; struct tm tmb;
tm = localtime_r (&t, &tmb); tm = ::localtime_r (&t, &tmb);
#endif #endif
#ifdef ASE_CHAR_IS_MCHAR #ifdef ASE_CHAR_IS_MCHAR
size_t len = strftime (buf, ASE_COUNTOF(buf), fmt, tm); size_t len = ::strftime (buf, ASE_COUNTOF(buf), fmt, tm);
#else #else
size_t len = wcsftime (buf, ASE_COUNTOF(buf), fmt, tm); size_t len = ::wcsftime (buf, ASE_COUNTOF(buf), fmt, tm);
#endif #endif
return ret->set (buf, len); return ret->set (buf, len);
@ -150,16 +150,16 @@ namespace ASE
char_t buf[128]; char_t buf[128];
struct tm* tm; struct tm* tm;
#ifdef _WIN32 #ifdef _WIN32
tm = gmtime (&t); tm = ::gmtime (&t);
#else #else
struct tm tmb; struct tm tmb;
tm = gmtime_r (&t, &tmb); tm = ::gmtime_r (&t, &tmb);
#endif #endif
#ifdef ASE_CHAR_IS_MCHAR #ifdef ASE_CHAR_IS_MCHAR
size_t len = strftime (buf, ASE_COUNTOF(buf), fmt, tm); size_t len = ::strftime (buf, ASE_COUNTOF(buf), fmt, tm);
#else #else
size_t len = wcsftime (buf, ASE_COUNTOF(buf), fmt, tm); size_t len = ::wcsftime (buf, ASE_COUNTOF(buf), fmt, tm);
#endif #endif
return ret->set (buf, len); return ret->set (buf, len);
@ -175,7 +175,7 @@ namespace ASE
#elif defined(ASE_CHAR_IS_MCHAR) #elif defined(ASE_CHAR_IS_MCHAR)
return ret->set ((long_t)::system(ptr)); return ret->set ((long_t)::system(ptr));
#else #else
char* mbs = (char*)ase_awk_malloc (ret->getAwk(), len*5+1); char* mbs = (char*)ase_awk_malloc (awk, len*5+1);
if (mbs == ASE_NULL) return -1; if (mbs == ASE_NULL) return -1;
::size_t mbl = ::wcstombs (mbs, ptr, len*5); ::size_t mbl = ::wcstombs (mbs, ptr, len*5);
@ -183,7 +183,7 @@ namespace ASE
mbs[mbl] = '\0'; mbs[mbl] = '\0';
int n = ret->set ((long_t)::system(mbs)); int n = ret->set ((long_t)::system(mbs));
ase_awk_free (ret->getAwk(), mbs); ase_awk_free (awk, mbs);
return n; return n;
#endif #endif
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: main.c,v 1.5 2007/05/16 09:28:33 bacon Exp $ * $Id: main.c,v 1.6 2007/05/20 16:21:09 bacon Exp $
* *
* {License} * {License}
*/ */
@ -85,4 +85,11 @@ exit_main:
return ret; return ret;
} }
#else
int ase_runmain (int argc, ase_achar_t* argv[], int(*mf) (int,ase_char_t*[]))
{
return mf (argc, argv);
}
#endif #endif