Module: wine Branch: refs/heads/master Commit: 427e488ba100bb8d4cbe5ddcd8c91cc856480a6a URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=427e488ba100bb8d4cbe5ddc...
Author: Bill Medland billmedland@mercuryspeed.com Date: Thu Apr 27 07:52:37 2006 -0700
wpp: Support long long constants if configure says long long is available
---
libs/wpp/ppl.l | 3 ++- libs/wpp/wpp_private.h | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 990fbb1..409706e 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -156,6 +156,7 @@ cident [a-zA-Z_][0-9a-zA-Z_]* 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 @@ static int make_number(int radix, YYSTYP if(is_ll) { /* Assume as in the declaration of wrc_ull_t and wrc_sll_t */ -#if defined(SIZEOF_LONGLONG) && SIZEOF_LONGLONG >= 8 +#ifdef HAVE_LONG_LONG if (is_u) { val->ull = strtoull(str, NULL, radix); diff --git a/libs/wpp/wpp_private.h b/libs/wpp/wpp_private.h index fe60f65..d8a752a 100644 --- a/libs/wpp/wpp_private.h +++ b/libs/wpp/wpp_private.h @@ -20,6 +20,10 @@ #ifndef __WINE_WPP_PRIVATE_H #define __WINE_WPP_PRIVATE_H
+#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + #include <stdio.h> #include <string.h>
@@ -133,14 +137,16 @@ typedef struct
/* - * 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 +#ifdef HAVE_LONG_LONG typedef long long wrc_sll_t; typedef unsigned long long wrc_ull_t; #else