First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Some common definitions for this component
22 #ifndef WIN_DRIVE_COMMON_H
23 #define WIN_DRIVE_COMMON_H
28 //-----------------------------------------------------------------------------
30 //-- define this macro in order to enable debug print.
31 #define THIS_EXT_DEBUG_PRINT
33 #if (defined(_DEBUG) || defined(_DEBUG_RELEASE)) && defined(THIS_EXT_DEBUG_PRINT)
34 #define __PRINT(t) {RDebug::Print(t);}
35 #define __PRINT1(t,a) {RDebug::Print(t,a);}
36 #define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
37 #define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
38 #define __PRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
39 #define __PRINTF(t) {RDebug::Printf(t);}
44 #define __PRINT2(t,a,b)
45 #define __PRINT3(t,a,b,c)
47 #define __PRINT4(t,a,b,c,d)
51 //-- this logging is always enabled
52 #define __LOG(t) {RDebug::Print(t);}
53 #define __LOG1(t,a) {RDebug::Print(t,a);}
54 #define __LOG2(t,a,b) {RDebug::Print(t,a,b);}
55 #define __LOG3(t,a,b,c) {RDebug::Print(t,a,b,c);}
56 #define __LOG4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
57 #define __LOGF(t) {RDebug::Printf(t);}
60 //-----------------------------------------------------------------------------
63 @param apStruct pointer to the data structure
66 inline void ZeroFillStruct(T* apStruct)
68 Mem::FillZ(apStruct,sizeof(T));
73 @param apStruct a reference to the data structure
76 inline void ZeroFillStruct(T& aStruct)
78 Mem::FillZ(&aStruct,sizeof(T));
82 Zero-fill memory. Just for consistency
83 @param apStruct pointer to the memory to be filled with zeroes
84 @param aBytes buffer size
86 inline void ZeroFillStruct(void* aStruct, TUint aBytes)
88 Mem::FillZ(aStruct,aBytes);
91 //-----------------------------------------------------------------------------
93 inline TBool IsPowerOf2(TUint32 aVal)
98 return !(aVal & (aVal-1));
103 #endif //WIN_DRIVE_COMMON_H