rev 182 - in trunk: . include/prothon src

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: bcollins
Date: 2004-03-28 09:48:58 -0500 (Sun, 28 Mar 2004)
New Revision: 182

Modified:
   trunk/Rules.mk.in
   trunk/include/prothon/prothon.h
   trunk/src/builtins.c
   trunk/src/interp.c
   trunk/src/memory_mgr.c
   trunk/src/sys.c
Log:
Get rid of some windows includes that aren't needed. Also make a common
LONG_LONG_FMT and LONG_LONG_CAST define in prothon.h so that we can move
the win32/unix differences to there instead of in the code.


Modified: trunk/Rules.mk.in
===================================================================
--- trunk/Rules.mk.in	2004-03-28 14:15:06 UTC (rev 181)
+++ trunk/Rules.mk.in	2004-03-28 14:48:58 UTC (rev 182)
@@ -21,7 +21,7 @@
 
 CFLAGS=@CFLAGS@
 CPPFLAGS=@CPPFLAGS@ -I$(abs_srcdir)/include -I$(srcdir) \
-	-I$(abs_builddir)/include \
+	-I$(abs_builddir)/include -DHAVE_CONFIG_H \
 	-DPROTHON_DEFAULT_MODDIR="\"$(PROTHON_DEFAULT_MODDIR)\""
 
 LDFLAGS=@LDFLAGS@

Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h	2004-03-28 14:15:06 UTC (rev 181)
+++ trunk/include/prothon/prothon.h	2004-03-28 14:48:58 UTC (rev 182)
@@ -73,8 +73,12 @@
 
 #ifdef WIN32
 #define PR_DECLARE_EXPORT(type)         __declspec(dllexport) type
+#define LONG_LONG_FMT			"%I64d"
+#define LONG_LONG_CAST			i64_t
 #else
 #define PR_DECLARE_EXPORT(type)         type
+#define LONG_LONG_FMT			"%lld"
+#define LONG_LONG_CAST			long long
 #endif
 
 //**************************** DEBUG DEFINITIONS *********************************

Modified: trunk/src/builtins.c
===================================================================
--- trunk/src/builtins.c	2004-03-28 14:15:06 UTC (rev 181)
+++ trunk/src/builtins.c	2004-03-28 14:48:58 UTC (rev 182)
@@ -601,11 +601,7 @@
 
 DEF(INT_OBJ, __str__, NULL){
 	char str[24];
-#ifdef WIN32
-	apr_snprintf(str, sizeof(str),   "%d", Int_value(self));
-#else
-	apr_snprintf(str, sizeof(str), "%lld", (long long) Int_value(self));
-#endif
+	apr_snprintf(str, sizeof(str), LONG_LONG_FMT, (LONG_LONG_CAST)Int_value(self));
 	return new_string_obj(str);
 }
 

Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c	2004-03-28 14:15:06 UTC (rev 181)
+++ trunk/src/interp.c	2004-03-28 14:48:58 UTC (rev 182)
@@ -1199,17 +1199,10 @@
 		printf("\nUncaught exception:\n");
 		if ((fstk_obj = get_attr(ist, orig_excobj, sym(ist, "frame_stack")))) {
 			for (i=list_len(ist, fstk_obj)-3; i >= 0; i -= 3)
-#ifdef WIN32
-				printf( "--- File: %s, line: %I64d, char: %I64d\n",  
+				printf( "--- File: %s, line: "LONG_LONG_FMT", char: %I64d\n",  
 					strch(list_item(ist, fstk_obj, i  )), 
-					*((i64_t*)obj_data_p(list_item(ist, fstk_obj, i+1))), 
-					*((i64_t*)obj_data_p(list_item(ist, fstk_obj, i+2))) );
-#else
-				printf( "--- File: %s, line: %lld, char: %lld\n",
-					strch(list_item(ist, fstk_obj, i  )),
-					*((long long *)obj_data_p(list_item(ist, fstk_obj, i+1))),
-					*((long long *)obj_data_p(list_item(ist, fstk_obj, i+2))) );
-#endif
+					*((LONG_LONG_CAST *)obj_data_p(list_item(ist, fstk_obj, i+1))), 
+					*((LONG_LONG_CAST *)obj_data_p(list_item(ist, fstk_obj, i+2))) );
 		}
 		if (bl)
 			for (i=list_len(ist, bl)-1; i >= 0; i--){

Modified: trunk/src/memory_mgr.c
===================================================================
--- trunk/src/memory_mgr.c	2004-03-28 14:15:06 UTC (rev 181)
+++ trunk/src/memory_mgr.c	2004-03-28 14:48:58 UTC (rev 182)
@@ -58,10 +58,6 @@
 #include "memory_mgr.h"
 #include "lock.h"
 
-#ifdef WIN32
-#include <windows.h>
-#endif
-
 #include <stdio.h>
 
 

Modified: trunk/src/sys.c
===================================================================
--- trunk/src/sys.c	2004-03-28 14:15:06 UTC (rev 181)
+++ trunk/src/sys.c	2004-03-28 14:48:58 UTC (rev 182)
@@ -53,7 +53,7 @@
 
 // sys.c
 
-#ifndef WIN32
+#ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
@@ -120,7 +120,7 @@
 #else
 	/* XXX The use of _fullpath() above is to make relative paths
 	 * absolute. I don't think this is needed in Unix, but we may need
-	 * to validate the location (_fullpath() checkes to make sure the
+	 * to validate the location (_fullpath() checks to make sure the
 	 * path exists). */
 	strncpy(full_path, path, sizeof(full_path));
 #endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.