mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix various Mac compile errors.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@115 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -17,6 +17,13 @@ template <class ClassName, class BaseName, class StructName>
|
||||
class CefCppToC : public CefThreadSafeBase<CefBase>
|
||||
{
|
||||
public:
|
||||
// Structure representation with pointer to the C++ class.
|
||||
struct Struct
|
||||
{
|
||||
StructName struct_;
|
||||
CefCppToC<ClassName,BaseName,StructName>* class_;
|
||||
};
|
||||
|
||||
// Use this method to retrieve the underlying class instance from our
|
||||
// own structure when the structure is passed as the required first
|
||||
// parameter of a C API function call. No explicit reference counting
|
||||
@ -24,8 +31,7 @@ public:
|
||||
static CefRefPtr<BaseName> Get(StructName* s)
|
||||
{
|
||||
// Cast our structure to the wrapper structure type.
|
||||
ClassName::Struct* wrapperStruct =
|
||||
reinterpret_cast<ClassName::Struct*>(s);
|
||||
Struct* wrapperStruct = reinterpret_cast<Struct*>(s);
|
||||
// Return the underlying object instance.
|
||||
return wrapperStruct->class_->GetClass();
|
||||
}
|
||||
@ -48,8 +54,7 @@ public:
|
||||
static CefRefPtr<BaseName> Unwrap(StructName* s)
|
||||
{
|
||||
// Cast our structure to the wrapper structure type.
|
||||
ClassName::Struct* wrapperStruct =
|
||||
reinterpret_cast<ClassName::Struct*>(s);
|
||||
Struct* wrapperStruct = reinterpret_cast<Struct*>(s);
|
||||
// Add the underlying object instance to a smart pointer.
|
||||
CefRefPtr<BaseName> objectPtr(wrapperStruct->class_->GetClass());
|
||||
// Release the reference to our wrapper object that was added before the
|
||||
@ -59,13 +64,6 @@ public:
|
||||
return objectPtr;
|
||||
}
|
||||
|
||||
// Structure representation with pointer to the C++ class.
|
||||
struct Struct
|
||||
{
|
||||
StructName struct_;
|
||||
CefCppToC<ClassName,BaseName,StructName>* class_;
|
||||
};
|
||||
|
||||
CefCppToC(BaseName* cls)
|
||||
: class_(cls)
|
||||
{
|
||||
|
Reference in New Issue
Block a user