Skip to content

Commit

Permalink
Fixing stuff... I think.
Browse files Browse the repository at this point in the history
  • Loading branch information
phoboslab committed Nov 5, 2013
1 parent 125ae96 commit 2a95067
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion JavaScriptCore/API/JSWrapperMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#import <JavaScriptCore/JavaScriptCore.h>
#import <JSValueInternal.h>
#import <objc/objc-runtime.h>
#include <objc/message.h>

#if JSC_OBJC_API_ENABLED

Expand Down
16 changes: 9 additions & 7 deletions WTF/wtf/StdLibExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,25 @@
* - http:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43976
*/
#if (CPU(ARM) || CPU(MIPS)) && COMPILER(GCC)
template<typename Type>
inline bool isPointerTypeAlignmentOkay(Type* ptr)
{
return !(reinterpret_cast<intptr_t>(ptr) % __alignof__(Type));
}

// HACK, throwing an error
//template<typename Type>
//inline bool isPointerTypeAlignmentOkay(Type* ptr)
//{
// return !(reinterpret_cast<intptr_t>(ptr) % __alignof__(Type));
//}

template<typename TypePtr>
inline TypePtr reinterpret_cast_ptr(void* ptr)
{
ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast<TypePtr>(ptr)));
// ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast<TypePtr>(ptr)));
return reinterpret_cast<TypePtr>(ptr);
}

template<typename TypePtr>
inline TypePtr reinterpret_cast_ptr(const void* ptr)
{
ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast<TypePtr>(ptr)));
// ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast<TypePtr>(ptr)));
return reinterpret_cast<TypePtr>(ptr);
}
#else
Expand Down

0 comments on commit 2a95067

Please sign in to comment.