msvc patches for khtml/kjs

Maciej Stachowiak mjs at apple.com
Wed Feb 15 09:44:03 CET 2006


On Feb 7, 2006, at 10:10 AM, Peter Kümmel wrote:

> With this patches khtml and kjs also compiles with msvc.
> Any objections?

Hi Peter,

What version of MSVC are you using? We have the same code in the  
WebKit repsository and it compiles fine with MSVC.

Regards,
Maciej

>
> Peter
>
> Index: lookup.h
> ===================================================================
> --- lookup.h	(Revision 506639)
> +++ lookup.h	(Arbeitskopie)
> @@ -265,8 +265,10 @@
>   * that cached object. Note that the object constructor must take  
> 1 argument, exec.
>   */
>  template <class ClassCtor>
> -inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec,  
> const KJS::Identifier &propertyName)
> +struct cacheGlobal
>  {
> +  static inline KJS::JSObject *Object(KJS::ExecState *exec, const  
> KJS::Identifier &propertyName)
> +  {
>    KJS::JSObject *globalObject = static_cast<KJS::JSObject *>(exec- 
> >lexicalInterpreter()->globalObject());
>    KJS::JSValue *obj = globalObject->getDirect(propertyName);
>    if (obj) {
> @@ -277,6 +279,7 @@
>    globalObject->put(exec, propertyName, newObject, KJS::Internal);
>    return newObject;
>  }
> +};
>
>  /**
>   * Helpers to define prototype objects (each of which simply  
> implements
> @@ -296,7 +299,7 @@
>   */
>  #define KJS_DEFINE_PROTOTYPE(ClassProto) \
>    class ClassProto : public KJS::JSObject { \
> -    friend KJS::JSObject *cacheGlobalObject<ClassProto> 
> (KJS::ExecState *exec, const KJS::Identifier &propertyName); \
> +    friend struct cacheGlobal<ClassProto>; \
>    public: \
>      static KJS::JSObject *self(KJS::ExecState *exec); \
>      virtual const KJS::ClassInfo *classInfo() const { return  
> &info; } \
> @@ -315,7 +318,7 @@
>      Identifier* ClassProto::s_name = 0; \
>      JSObject *ClassProto::self(ExecState *exec) \
>      { \
> -      return cacheGlobalObject<ClassProto>(exec, *name()); \
> +      return cacheGlobal<ClassProto>::Object(exec, *name()); \
>      } \
>      bool ClassProto::getOwnPropertySlot(ExecState *exec, const  
> Identifier& propertyName, PropertySlot& slot) \
>      { \
> @@ -332,7 +335,7 @@
>      Identifier* ClassProto::s_name = 0; \
>      JSObject *ClassProto::self(ExecState *exec) \
>      { \
> -      return cacheGlobalObject<ClassProto>(exec, *name()); \
> +      return cacheGlobal<ClassProto>::Object(exec, *name()); \
>      } \
>      bool ClassProto::getOwnPropertySlot(ExecState *exec, const  
> Identifier& propertyName, PropertySlot& slot) \
>      { \
> Index: ecma/kjs_range.cpp
> ===================================================================
> --- ecma/kjs_range.cpp	(Revision 506639)
> +++ ecma/kjs_range.cpp	(Arbeitskopie)
> @@ -212,7 +212,7 @@
>
>  ValueImp *KJS::getRangeConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<RangeConstructor>(exec,  
> "[[range.constructor]]");
> +  return cacheGlobal<RangeConstructor>::Object(exec,  
> "[[range.constructor]]");
>  }
>
>
> Index: ecma/kjs_dom.cpp
> ===================================================================
> --- ecma/kjs_dom.cpp	(Revision 506639)
> +++ ecma/kjs_dom.cpp	(Arbeitskopie)
> @@ -1642,7 +1642,7 @@
>
>  ObjectImp *KJS::getNodeConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<NodeConstructor>(exec,  
> "[[node.constructor]]");
> +  return cacheGlobal<NodeConstructor>::Object(exec,  
> "[[node.constructor]]");
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> @@ -1724,7 +1724,7 @@
>
>  ObjectImp *KJS::getDOMExceptionConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<DOMExceptionConstructor>(exec,  
> "[[DOMException.constructor]]");
> +  return cacheGlobal<DOMExceptionConstructor>::Object(exec,  
> "[[DOMException.constructor]]");
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> Index: ecma/kjs_css.cpp
> ===================================================================
> --- ecma/kjs_css.cpp	(Revision 506678)
> +++ ecma/kjs_css.cpp	(Arbeitskopie)
> @@ -976,7 +976,7 @@
>
>  ValueImp *getCSSRuleConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<CSSRuleConstructor>( exec,  
> "[[cssRule.constructor]]" );
> +  return cacheGlobal<CSSRuleConstructor>::Object( exec,  
> "[[cssRule.constructor]]" );
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> @@ -1091,7 +1091,7 @@
>
>  ValueImp *getCSSValueConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<CSSValueConstructor>( exec,  
> "[[cssValue.constructor]]" );
> +  return cacheGlobal<CSSValueConstructor>::Object( exec,  
> "[[cssValue.constructor]]" );
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> @@ -1206,7 +1206,7 @@
>
>  ValueImp *getCSSPrimitiveValueConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<CSSPrimitiveValueConstructor>( exec,  
> "[[cssPrimitiveValue.constructor]]" );
> +  return cacheGlobal<CSSPrimitiveValueConstructor>::Object( exec,  
> "[[cssPrimitiveValue.constructor]]" );
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> Index: ecma/kjs_traversal.cpp
> ===================================================================
> --- ecma/kjs_traversal.cpp	(Revision 506639)
> +++ ecma/kjs_traversal.cpp	(Arbeitskopie)
> @@ -146,7 +146,7 @@
>
>  ValueImp *KJS::getNodeFilterConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<NodeFilterConstructor>(exec,  
> "[[nodeFilter.constructor]]");
> +  return cacheGlobal<NodeFilterConstructor>::Object(exec,  
> "[[nodeFilter.constructor]]");
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> Index: ecma/kjs_events.cpp
> ===================================================================
> --- ecma/kjs_events.cpp	(Revision 506639)
> +++ ecma/kjs_events.cpp	(Arbeitskopie)
> @@ -265,7 +265,7 @@
>
>  ValueImp *KJS::getEventConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<EventConstructor>(exec,  
> "[[event.constructor]]");
> +  return cacheGlobal<EventConstructor>::Object(exec,  
> "[[event.constructor]]");
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> @@ -461,7 +461,7 @@
>
>  ValueImp *KJS::getEventExceptionConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<EventExceptionConstructor>(exec,  
> "[[eventException.constructor]]");
> +  return cacheGlobal<EventExceptionConstructor>::Object(exec,  
> "[[eventException.constructor]]");
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> @@ -913,7 +913,7 @@
>
>  ValueImp* KJS::getKeyboardEventConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<KeyboardEventConstructor>(exec,  
> "[[keyboardEvent.constructor]]");
> +  return cacheGlobal<KeyboardEventConstructor>::Object(exec,  
> "[[keyboardEvent.constructor]]");
>  }
>
>
> @@ -944,7 +944,7 @@
>
>  ValueImp *KJS::getMutationEventConstructor(ExecState *exec)
>  {
> -  return cacheGlobalObject<MutationEventConstructor>(exec,  
> "[[mutationEvent.constructor]]");
> +  return cacheGlobal<MutationEventConstructor>::Object(exec,  
> "[[mutationEvent.constructor]]");
>  }
>
>  //  
> ---------------------------------------------------------------------- 
> ---
> Index: ecma/kjs_debugwin.cpp
> ===================================================================
> --- ecma/kjs_debugwin.cpp	(Revision 506639)
> +++ ecma/kjs_debugwin.cpp	(Arbeitskopie)
> @@ -1089,6 +1089,7 @@
>
>    return str;
>  #endif
> +  return "";
>  }
>
>  bool KJSDebugWin::setBreakpoint(int sourceId, int lineno)
> _______________________________________________
> Khtml-devel at kde.org
> https://mail.kde.org/mailman/listinfo/khtml-devel



More information about the Khtml-devel mailing list