Changeset 56085 in webkit for trunk/JavaScriptCore/wtf/StdLibExtras.h
- Timestamp:
- Mar 16, 2010, 2:07:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/StdLibExtras.h
r56081 r56085 1 1 /* 2 * Copyright (C) 2008 , 2010Apple Inc. All Rights Reserved.2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #define WTF_StdLibExtras_h 28 28 29 #include <stdlib.h>30 29 #include <wtf/Assertions.h> 31 30 … … 55 54 namespace WTF { 56 55 57 // C++'s idea of a reinterpret_cast lacks sufficient cojones. 56 /* 57 * C++'s idea of a reinterpret_cast lacks sufficient cojones. 58 */ 58 59 template<typename TO, typename FROM> 59 inlineTO bitwise_cast(FROM from)60 TO bitwise_cast(FROM from) 60 61 { 61 62 COMPILE_ASSERT(sizeof(TO) == sizeof(FROM), WTF_bitwise_cast_sizeof_casted_types_is_equal); … … 76 77 } 77 78 78 // Returns the length of an array. Use instead of macros such as ARRAYSIZE.79 template<class ElementType, size_t length>80 inline size_t arrayLength(ElementType (&)[length])81 {82 return length;83 }84 85 79 } // namespace WTF 86 80 87 using WTF::arrayLength;88 using WTF::bitCount;89 using WTF::bitwise_cast;90 91 81 #endif
Note:
See TracChangeset
for help on using the changeset viewer.