implement long long constant parsing in wpp

Bill Medland billmedland at mercuryspeed.com
Thu Apr 20 17:32:00 CDT 2006


Bill Medland (billmedland at mercuryspeed.com)
Get wrc to handle long long constants
I assume that if SIZEOF_LONGLONG is defined then strtoull and strtoll will be.
This at least allows wrc to parse resource files that happen to include
headers containing long long constants; I don't know enough to test that
the long long arithmetic also works etc.

Index: wine/libs/wpp/ppl.l
===================================================================
RCS file: /home/wine/wine/libs/wpp/ppl.l,v
retrieving revision 1.9
diff -u -r1.9 ppl.l
--- wine/libs/wpp/ppl.l 5 Jan 2006 16:56:09 -0000 1.9
+++ wine/libs/wpp/ppl.l 20 Apr 2006 22:26:37 -0000
@@ -821,9 +821,28 @@
  }
 
  if(is_ll)
-  pp_internal_error(__FILE__, __LINE__, "long long constants not implemented yet");
-
- if(is_u && is_l)
+        {
+/* Assume as in the declaration of wrc_ull_t and wrc_sll_t */
+           if (is_u) 
+           {
+#if defined(SIZEOF_LONGLONG) && SIZEOF_LONGLONG >= 8
+  val->ull = strtoull(str, NULL, radix);
+#else
+  val->ull = strtoul(str, NULL, radix);
+#endif
+  return tULONGLONG;
+           }
+           else
+           {
+#if defined(SIZEOF_LONGLONG) && SIZEOF_LONGLONG >= 8
+  val->sll = strtoll(str, NULL, radix);
+#else
+  val->sll = strtol(str, NULL, radix);
+#endif
+  return tSLONGLONG;
+           }
+        }
+        else if(is_u && is_l)
  {
   val->ulong = strtoul(str, NULL, radix);
   return tULONG;



More information about the wine-patches mailing list