<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>20410</bug_id>
          
          <creation_ts>2008-08-16 10:57:23 -0700</creation_ts>
          <short_desc>Compile-failure: undefined token in WebCore/platform/network/curl/FormDataStreamCurl.cpp</short_desc>
          <delta_ts>2008-08-18 15:47:36 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Daniel Macks">dmacks</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88632</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Macks">dmacks</who>
    <bug_when>2008-08-16 10:57:23 -0700</bug_when>
    <thetext>Compiling webkit source (nightly r35788) on OS X 10.4, using all gtk and other non-apple-supplied support libs using latest available from fink unstable tree...

1. ./autogen.sh --prefix=/sw --with-target=x11 --with-http-backend=curl --with-font-backend-pango --disable-video

no configure problems...Build configuration reports &quot;HTTP backend: curl&quot;

2. make

/bin/sh ./libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -DWTF_USE_ICU_UNICODE=1 -DBUILDING_CAIRO__=1 -DBUILDING_GTK__=1 -DWTF_CHANGES  -DXP_UNIX -DNDEBUG    -I./WebCore -I./WebCore/platform -I./WebCore/platform/network -I./WebCore/platform/graphics -I./WebCore/platform/graphics/filters -I./WebCore/platform/text -I./WebCore/loader -I./WebCore/loader/appcache -I./WebCore/loader/archive -I./WebCore/loader/icon -I./WebCore/css -I./WebCore/dom -I./WebCore/page -I./WebCore/bridge -I./WebCore/bridge/c -I./WebCore/editing -I./WebCore/history -I./WebCore/xml -I./WebCore/html -I./WebCore/bindings/js -I./WebCore/platform/image-decoders -I./WebCore/platform/image-decoders/bmp -I./WebCore/platform/image-decoders/gif -I./WebCore/platform/image-decoders/ico -I./WebCore/platform/image-decoders/jpeg -I./WebCore/platform/image-decoders/png -I./WebCore/platform/image-decoders/xbm -I./WebCore/plugins -I./WebCore/rendering -I./WebCore/rendering/style -I./WebCore/bindings/js -DWTF_USE_CURL=1 -I./WebCore/platform/network/curl  -DENABLE_OFFLINE_WEB_APPLICATIONS=1 -DENABLE_DASHBOARD_SUPPORT=1 -DENABLE_DATABASE=1 -I./WebCore/platform/sql -I./WebCore/storage -DENABLE_DOM_STORAGE=1 -I./WebCore/storage -DENABLE_ICONDATABASE=1   -DENABLE_XPATH=1 -DENABLE_XSLT=1 -DENABLE_SVG=1 -I\./WebCore/svg -I\./WebCore/svg/animation -I\./WebCore/svg/graphics -I\./WebCore/svg/graphics/filters -DENABLE_SVG_USE=1 -DENABLE_SVG_FOREIGN_OBJECT=1 -DENABLE_SVG_FONTS=1  -DENABLE_SVG_AS_IMAGE=1 -DENABLE_SVG_ANIMATION=1 -I./JavaScriptCore -I./JavaScriptCore/ForwardingHeaders -I./JavaScriptCore/wtf -I./JavaScriptCore/kjs -I./DerivedSources -I./JavaScriptCore/API -I./JavaScriptCore/ForwardingHeaders -I./JavaScriptCore/VM -I./JavaScriptCore/profiler -I./JavaScriptCore/wtf/unicode -I./JavaScriptCore/pcre -I./JavaScriptCore/kjs  -I./WebCore/platform/gtk -I./WebCore/platform/graphics/gtk -I./WebCore/platform/graphics/cairo -I./WebCore/loader/gtk -I./WebCore/page/gtk -DUSE_FREETYPE=1  -I./WebCore/svg/graphics/cairo  -I/sw/include -fno-strict-aliasing -O2 -fvisibility-inlines-hidden -fno-rtti -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -fvisibility=hidden -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I./JavaScriptCore/icu -I./WebCore/icu -I/sw/lib/pango-ft219/include/pango-1.0 -I/sw/lib/fontconfig2/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/include/libxml2 -I/sw/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include/cairo -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/gtk-2.0 -I/sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/X11R6/include   -I/sw/include    -I/sw/lib/fontconfig2/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include -I/sw/include/cairo -I/usr/X11R6/include -I/sw/include    -I/sw/include/libxml2 -I/sw/include    -MT WebCore/platform/network/curl/libWebCore_la-FormDataStreamCurl.lo -MD -MP -MF WebCore/platform/network/curl/.deps/libWebCore_la-FormDataStreamCurl.Tpo -c -o WebCore/platform/network/curl/libWebCore_la-FormDataStreamCurl.lo `test -f &apos;WebCore/platform/network/curl/FormDataStreamCurl.cpp&apos; || echo &apos;./&apos;`WebCore/platform/network/curl/FormDataStreamCurl.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -DWTF_USE_ICU_UNICODE=1 -DBUILDING_CAIRO__=1 -DBUILDING_GTK__=1 -DWTF_CHANGES -DXP_UNIX -DNDEBUG -I./WebCore -I./WebCore/platform -I./WebCore/platform/network -I./WebCore/platform/graphics -I./WebCore/platform/graphics/filters -I./WebCore/platform/text -I./WebCore/loader -I./WebCore/loader/appcache -I./WebCore/loader/archive -I./WebCore/loader/icon -I./WebCore/css -I./WebCore/dom -I./WebCore/page -I./WebCore/bridge -I./WebCore/bridge/c -I./WebCore/editing -I./WebCore/history -I./WebCore/xml -I./WebCore/html -I./WebCore/bindings/js -I./WebCore/platform/image-decoders -I./WebCore/platform/image-decoders/bmp -I./WebCore/platform/image-decoders/gif -I./WebCore/platform/image-decoders/ico -I./WebCore/platform/image-decoders/jpeg -I./WebCore/platform/image-decoders/png -I./WebCore/platform/image-decoders/xbm -I./WebCore/plugins -I./WebCore/rendering -I./WebCore/rendering/style -I./WebCore/bindings/js -DWTF_USE_CURL=1 -I./WebCore/platform/network/curl -DENABLE_OFFLINE_WEB_APPLICATIONS=1 -DENABLE_DASHBOARD_SUPPORT=1 -DENABLE_DATABASE=1 -I./WebCore/platform/sql -I./WebCore/storage -DENABLE_DOM_STORAGE=1 -I./WebCore/storage -DENABLE_ICONDATABASE=1 -DENABLE_XPATH=1 -DENABLE_XSLT=1 -DENABLE_SVG=1 -I./WebCore/svg -I./WebCore/svg/animation -I./WebCore/svg/graphics -I./WebCore/svg/graphics/filters -DENABLE_SVG_USE=1 -DENABLE_SVG_FOREIGN_OBJECT=1 -DENABLE_SVG_FONTS=1 -DENABLE_SVG_AS_IMAGE=1 -DENABLE_SVG_ANIMATION=1 -I./JavaScriptCore -I./JavaScriptCore/ForwardingHeaders -I./JavaScriptCore/wtf -I./JavaScriptCore/kjs -I./DerivedSources -I./JavaScriptCore/API -I./JavaScriptCore/ForwardingHeaders -I./JavaScriptCore/VM -I./JavaScriptCore/profiler -I./JavaScriptCore/wtf/unicode -I./JavaScriptCore/pcre -I./JavaScriptCore/kjs -I./WebCore/platform/gtk -I./WebCore/platform/graphics/gtk -I./WebCore/platform/graphics/cairo -I./WebCore/loader/gtk -I./WebCore/page/gtk -DUSE_FREETYPE=1 -I./WebCore/svg/graphics/cairo -I/sw/include -fno-strict-aliasing -O2 -fvisibility-inlines-hidden -fno-rtti -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -fvisibility=hidden -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I./JavaScriptCore/icu -I./WebCore/icu -I/sw/lib/pango-ft219/include/pango-1.0 -I/sw/lib/fontconfig2/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/include/libxml2 -I/sw/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include/cairo -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/gtk-2.0 -I/sw/include/atk-1.0 -I/sw/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/X11R6/include -I/sw/include -I/sw/lib/fontconfig2/include -I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include -I/sw/include/pixman-1 -I/sw/include/libpng12 -I/sw/include -I/sw/include/cairo -I/usr/X11R6/include -I/sw/include -I/sw/include/libxml2 -I/sw/include -MT WebCore/platform/network/curl/libWebCore_la-FormDataStreamCurl.lo -MD -MP -MF WebCore/platform/network/curl/.deps/libWebCore_la-FormDataStreamCurl.Tpo -c WebCore/platform/network/curl/FormDataStreamCurl.cpp  -fno-common -DPIC -o WebCore/platform/network/curl/.libs/libWebCore_la-FormDataStreamCurl.o
WebCore/platform/network/curl/FormDataStreamCurl.cpp:36:8: warning: undefining &quot;__STDC_LIMIT_MACROS&quot;
WebCore/platform/network/curl/FormDataStreamCurl.cpp: In member function &apos;size_t WebCore::FormDataStream::read(void*, size_t, size_t)&apos;:
WebCore/platform/network/curl/FormDataStreamCurl.cpp:58: error: &apos;SIZE_MAX&apos; was not declared in this scope
make[1]: *** [WebCore/platform/network/curl/libWebCore_la-FormDataStreamCurl.lo] Error 1
make: *** [all] Error 2

I think SIZE_MAX is in stdint.h; will test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88633</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Macks">dmacks</who>
    <bug_when>2008-08-16 11:25:44 -0700</bug_when>
    <thetext>FormDataStreamCurl.cpp tries to get stdint.h:

#include &quot;config.h&quot;
// We need to define __STDC_LIMIT_MACROS to define SIZE_MAX.
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#include &lt;stdint.h&gt;
#undef __STDC_LIMIT_MACROS
#else
#include &lt;stdint.h&gt;
#endif

but tracing the #include jungle, it looks like that&apos;s too late, as stdint.h has already been loaded...

In file included from /usr/include/sys/_endian.h:88,
                 from /usr/include/ppc/endian.h:107,
                 from /usr/include/machine/endian.h:30,
                 from /usr/include/sys/wait.h:182,
                 from /usr/include/stdlib.h:64,
                 from ./JavaScriptCore/wtf/FastMalloc.h:25,
                 from ./WebCore/config.h:77,
                 from WebCore/platform/network/curl/FormDataStreamCurl.cpp:30

Moving the config.h *after* stdint.h solves it for me (and makes some sense...load all the system headers before webkit&apos;s own stuff. Not sure if that affects win32, which may do headers differently and/or need local overrides of standard-on-unix stuff.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88647</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-08-16 18:00:16 -0700</bug_when>
    <thetext>It&apos;s probably a lot more portable, and definitely cleaner, to use std::numeric_limits&lt;size_t&gt;::max() instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88681</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Macks">dmacks</who>
    <bug_when>2008-08-17 09:06:40 -0700</bug_when>
    <thetext>Using that instead of SIZE_MAX (and scrapping the whole stdint.h block entirely) allows building with no warnings or undefined symbols.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88710</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-08-18 05:52:49 -0700</bug_when>
    <thetext>Thanks! Would you be willing to submit a patch &lt;http://webkit.org/coding/contributing.html&gt;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88762</commentid>
    <comment_count>5</comment_count>
      <attachid>22863</attachid>
    <who name="Daniel Macks">dmacks</who>
    <bug_when>2008-08-18 14:50:31 -0700</bug_when>
    <thetext>Created attachment 22863
patch per Comment #3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88768</commentid>
    <comment_count>6</comment_count>
      <attachid>22863</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-08-18 15:44:30 -0700</bug_when>
    <thetext>Comment on attachment 22863
patch per Comment #3

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88769</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-08-18 15:47:36 -0700</bug_when>
    <thetext>Landed in r35826.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>22863</attachid>
            <date>2008-08-18 14:50:31 -0700</date>
            <delta_ts>2008-08-18 15:44:30 -0700</delta_ts>
            <desc>patch per Comment #3</desc>
            <filename>size-max-fix.patch</filename>
            <type>text/plain</type>
            <size>1550</size>
            <attacher name="Daniel Macks">dmacks</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAzNTgyMykKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTQgQEAKKzIwMDgtMDgtMTggIERhbmllbCBNYWNrcyAgPGRtYWNrc0BuZXRzcGFj
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I3VuZGVmIF9fU1REQ19MSU1JVF9NQUNST1MKLSNlbHNlCi0jaW5j
bHVkZSA8c3RkaW50Lmg+Ci0jZW5kaWYKLQogI2luY2x1ZGUgIkZvcm1EYXRhU3RyZWFtQ3VybC5o
IgogCiAjaW5jbHVkZSAiQ1N0cmluZy5oIgpAQCAtNTUsNyArNDYsNyBAQCBGb3JtRGF0YVN0cmVh
bTo6fkZvcm1EYXRhU3RyZWFtKCkKIHNpemVfdCBGb3JtRGF0YVN0cmVhbTo6cmVhZCh2b2lkKiBw
dHIsIHNpemVfdCBibG9ja1NpemUsIHNpemVfdCBudW1iZXJPZkJsb2NrcykKIHsKICAgICAvLyBD
aGVjayBmb3Igb3ZlcmZsb3cuCi0gICAgaWYgKCFudW1iZXJPZkJsb2NrcyB8fCBibG9ja1NpemUg
PiBTSVpFX01BWCAvIG51bWJlck9mQmxvY2tzKQorICAgIGlmICghbnVtYmVyT2ZCbG9ja3MgfHwg
YmxvY2tTaXplID4gc3RkOjpudW1lcmljX2xpbWl0czxzaXplX3Q+OjptYXgoKSAvIG51bWJlck9m
QmxvY2tzKQogICAgICAgICByZXR1cm4gMDsKIAogICAgIFZlY3RvcjxGb3JtRGF0YUVsZW1lbnQ+
IGVsZW1lbnRzOwo=
</data>
<flag name="review"
          id="10167"
          type_id="1"
          status="+"
          setter="mrowe"
    />
          </attachment>
      

    </bug>

</bugzilla>