wpp support for long constants (take 2 - corrected config.h inclusion)

Bill Medland billmedland at mercuryspeed.com
Thu Apr 27 09:52:37 CDT 2006


Bill Medland (billmedland at mercuryspeed.com)
Support long long constants if the configure says long long is available

Index: wine/libs/wpp/ppl.l
===================================================================
RCS file: /home/wine/wine/libs/wpp/ppl.l,v
retrieving revision 1.10
diff -u -r1.10 ppl.l
--- wine/libs/wpp/ppl.l 21 Apr 2006 11:17:41 -0000 1.10
+++ wine/libs/wpp/ppl.l 27 Apr 2006 14:46:41 -0000
@@ -156,6 +156,7 @@
 ul [uUlL]|[uUlL][lL]|[lL][uU]|[lL][lL][uU]|[uU][lL][lL]|[lL][uU][lL]
 
 %{
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -823,7 +824,7 @@
  if(is_ll)
  {
 /* Assume as in the declaration of wrc_ull_t and wrc_sll_t */
-#if defined(SIZEOF_LONGLONG) && SIZEOF_LONGLONG >= 8
+#if defined(HAVE_LONG_LONG)
   if (is_u)
   {
    val->ull = strtoull(str, NULL, radix);
Index: wine/libs/wpp/wpp_private.h
===================================================================
RCS file: /home/wine/wine/libs/wpp/wpp_private.h,v
retrieving revision 1.3
diff -u -r1.3 wpp_private.h
--- wine/libs/wpp/wpp_private.h 10 Oct 2005 18:06:50 -0000 1.3
+++ wine/libs/wpp/wpp_private.h 27 Apr 2006 14:46:42 -0000
@@ -15,6 +15,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * config.h must be included before this file.
  */
 
 #ifndef __WINE_WPP_PRIVATE_H
@@ -133,14 +135,16 @@
 
 
 /*
- * I assume that 'long long' exists in the compiler when it has a size
- * of 8 or bigger. If not, then we revert to a simple 'long' for now.
+ * If the configure says we have long long then we can use it.  Presumably
+ * if we have long long then we have strtoull and strtoll too.  If that is
+ * not the case we will need to add to the configure tests.
+ * If we do not have long long , then we revert to a simple 'long' for now.
  * This should prevent most unexpected things with other compilers than
  * gcc and egcs for now.
  * In the future it should be possible to use another way, like a
  * structure, so that we can emulate the MS compiler.
  */
-#if defined(SIZEOF_LONGLONG) && SIZEOF_LONGLONG >= 8
+#if defined(HAVE_LONG_LONG)
 typedef long long wrc_sll_t;
 typedef unsigned long long wrc_ull_t;
 #else



More information about the wine-patches mailing list