diff --git a/ase/ase.bdsgroup b/ase/ase.bdsgroup
index f7e97294..09ab95b9 100644
--- a/ase/ase.bdsgroup
+++ b/ase/ase.bdsgroup
@@ -13,6 +13,10 @@
test\awk\aseawk.bdsproj
aseawk.lib aseawk.exe
-
+
+
+
+
+
diff --git a/ase/awk/aseawk.bdsproj b/ase/awk/aseawk.bdsproj
index 2a21ae8a..a1b1e7ff 100644
--- a/ase/awk/aseawk.bdsproj
+++ b/ase/awk/aseawk.bdsproj
@@ -14,7 +14,7 @@
-
+
@@ -200,6 +200,7 @@
+
diff --git a/ase/awk/awk_i.h b/ase/awk/awk_i.h
index ee20c36f..23927556 100644
--- a/ase/awk/awk_i.h
+++ b/ase/awk/awk_i.h
@@ -1,5 +1,5 @@
/*
- * $Id: awk_i.h,v 1.74 2006-10-26 08:17:37 bacon Exp $
+ * $Id: awk_i.h,v 1.75 2006-10-27 10:28:52 bacon Exp $
*/
#ifndef _ASE_AWK_AWKI_H_
@@ -25,6 +25,12 @@ typedef struct ase_awk_tree_t ase_awk_tree_t;
#pragma warning (disable: 4996)
#endif
+/* TODO: remove this */
+#ifdef _WIN32
+#include
+#define xp_printf _tprintf
+#endif
+
#define ASE_AWK_MAX_GLOBALS 9999
#define ASE_AWK_MAX_LOCALS 9999
#define ASE_AWK_MAX_PARAMS 9999
diff --git a/ase/test/awk/aseawk.bdsproj b/ase/test/awk/aseawk.bdsproj
index 9d9c28dd..02df0e34 100644
--- a/ase/test/awk/aseawk.bdsproj
+++ b/ase/test/awk/aseawk.bdsproj
@@ -3,7 +3,7 @@
-
+
@@ -12,235 +12,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-False
-False
-1
-0
-0
-0
-False
-False
-False
-False
-False
-1033
-1252
-
-
-
-1.0.0.0
-
-
-
-
-
-1.0.0.0
-
-
-
-
-
-
-
-
-
-
-True
-
-
-
-
-
-
-False
-
-False
-
-True
-False
-
-
-
-
-
-
-
-
-
-
+
+ FalseFalse1000FalseFalseFalseFalseFalse103312521.0.0.01.0.0.0arg.awk ""TrueC:\projects\ase\test\awkFalseFalseTrueFalse
-
-mkdir $(PROJECTDIR)..\..\release\win32\bds
+ mkdir $(PROJECTDIR)..\..\release\win32\bds
mkdir $(PROJECTDIR)..\..\debug\win32\bds
-
-
-
-
+
diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c
index 563f7f0b..07618cb3 100644
--- a/ase/test/awk/awk.c
+++ b/ase/test/awk/awk.c
@@ -1,5 +1,5 @@
/*
- * $Id: awk.c,v 1.104 2006-10-27 09:19:21 bacon Exp $
+ * $Id: awk.c,v 1.105 2006-10-27 10:28:53 bacon Exp $
*/
#include
@@ -615,11 +615,7 @@ static void __awk_free (void* ptr, void* custom_data)
#endif
}
-#if defined(__STAND_ALONE) && !defined(_WIN32)
-static int __main (int argc, char* argv[])
-#else
static int __main (int argc, ase_char_t* argv[])
-#endif
{
ase_awk_t* awk;
ase_awk_srcios_t srcios;
@@ -647,11 +643,7 @@ static int __main (int argc, ase_char_t* argv[])
for (i = 1; i < argc; i++)
{
-#if defined(__STAND_ALONE) && !defined(_WIN32)
- if (strcmp(argv[i], "-m") == 0)
-#else
if (ase_awk_strcmp(argv[i], ASE_T("-m")) == 0)
-#endif
{
opt |= ASE_AWK_RUNMAIN;
}
@@ -745,13 +737,13 @@ static int __main (int argc, ase_char_t* argv[])
if (ase_awk_parse (awk, &srcios) == -1)
{
int errnum = ase_awk_geterrnum(awk);
-#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
- xp_printf (
+#if !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
+ wprintf (
ASE_T("ERROR: cannot parse program - line %u [%d] %ls\n"),
(unsigned int)ase_awk_getsrcline(awk),
errnum, ase_awk_geterrstr(errnum));
#else
- xp_printf (
+ _tprintf (
ASE_T("ERROR: cannot parse program - line %u [%d] %s\n"),
(unsigned int)ase_awk_getsrcline(awk),
errnum, ase_awk_geterrstr(errnum));
@@ -787,12 +779,12 @@ static int __main (int argc, ase_char_t* argv[])
if (ase_awk_run (awk, &runios, &runcbs, runarg) == -1)
{
int errnum = ase_awk_geterrnum(awk);
-#if defined(__STAND_ALONE) && !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
- xp_printf (
+#if !defined(_WIN32) && defined(ASE_CHAR_IS_WCHAR)
+ wprintf (
ASE_T("error: cannot run program - [%d] %ls\n"),
errnum, ase_awk_geterrstr(errnum));
#else
- xp_printf (
+ _tprintf (
ASE_T("error: cannot run program - [%d] %s\n"),
errnum, ase_awk_geterrstr(errnum));
#endif
@@ -939,9 +931,9 @@ typedef struct _PEB {
*/
-void* __declspec(naked) get_current_teb (void)
+void* /*__declspec(naked)*/ get_current_teb (void)
{
- _asm
+ _asm
{
mov eax, fs:[0x18]
}
@@ -960,7 +952,7 @@ int is_debugger_present (void)
}
-int __declspec(naked) is_debugger_present2 (void)
+int /*__declspec(naked)*/ is_debugger_present2 (void)
{
_asm
{
@@ -974,8 +966,6 @@ int __declspec(naked) is_debugger_present2 (void)
#if defined(_WIN32)
int _tmain (int argc, ase_char_t* argv[])
-#elif defined(__STAND_ALONE)
-int main (int argc, char* argv[])
#else
int xp_main (int argc, ase_char_t* argv[])
#endif
@@ -988,29 +978,18 @@ int xp_main (int argc, ase_char_t* argv[])
_CrtSetDbgFlag (_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_ALWAYS_DF);
#endif*/
-#ifdef _WIN32
-{
-ase_char_t buf[ase_sizeof(ase_long_t)*8+2+2];
-ase_size_t n;
-n = ase_awk_longtostr (-0x7FFFFFFFFFFFFFFFi64, 16, ASE_T("0x"), buf, ase_countof(buf));
-if (n == (ase_size_t)-1)
-{
- xp_printf (ASE_T("cannot convert...\n"));
-}
-else xp_printf (ASE_T("%d, %s\n"), n, buf);
-}
-
+#if defined(_WIN32)
if (IsDebuggerPresent ())
{
- xp_printf (ASE_T("Running application in a debugger....\n"));
+ _tprintf (_T("Running application in a debugger....\n"));
}
if (is_debugger_present ())
{
- xp_printf (ASE_T("Running application in a debugger by is_debugger_present...\n"));
+ _tprintf (_T("Running application in a debugger by is_debugger_present...\n"));
}
if (is_debugger_present2 ())
{
- xp_printf (ASE_T("Running application in a debugger by is_debugger_present2...\n"));
+ _tprintf (_T("Running application in a debugger by is_debugger_present2...\n"));
}
#endif
@@ -1019,9 +998,11 @@ else xp_printf (ASE_T("%d, %s\n"), n, buf);
#if defined(__linux) && defined(_DEBUG)
muntrace ();
#endif
-#if defined(_WIN32) && defined(_MSC_VER) && defined(_DEBUG)
+#if defined(_WIN32) && defined(_DEBUG)
+ #if defined(_MSC_VER)
_CrtDumpMemoryLeaks ();
- wprintf (L"Press ENTER to quit\n");
+ #endif
+ _tprintf (_T("Press ENTER to quit\n"));
getchar ();
#endif