os/ossrv/ssl/libssl/inc/libssl_wsd_defs.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ssl/libssl/inc/libssl_wsd_defs.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,77 @@
     1.4 +/*
     1.5 +Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
     1.6 +
     1.7 +Redistribution and use in source and binary forms, with or without 
     1.8 +modification, are permitted provided that the following conditions are met:
     1.9 +
    1.10 +* Redistributions of source code must retain the above copyright notice, this 
    1.11 +  list of conditions and the following disclaimer.
    1.12 +* Redistributions in binary form must reproduce the above copyright notice, 
    1.13 +  this list of conditions and the following disclaimer in the documentation 
    1.14 +  and/or other materials provided with the distribution.
    1.15 +* Neither the name of Nokia Corporation nor the names of its contributors 
    1.16 +  may be used to endorse or promote products derived from this software 
    1.17 +  without specific prior written permission.
    1.18 +
    1.19 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
    1.20 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
    1.21 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
    1.22 +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
    1.23 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
    1.24 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
    1.25 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
    1.26 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
    1.27 +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    1.28 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.29 +
    1.30 +Description:
    1.31 +*/
    1.32 +
    1.33 + 
    1.34 +#ifndef _LIBSSL_WSD_DEFS_H_
    1.35 +#define _LIBSSL_WSD_DEFS_H_
    1.36 +
    1.37 +#if (defined(SYMBIAN) && (defined(__WINSCW__) || defined(__WINS__)))
    1.38 +#ifdef EMULATOR
    1.39 +#undef EMULATOR
    1.40 +#endif
    1.41 +#ifdef GET_WSD_VAR_NAME
    1.42 +#undef GET_WSD_VAR_NAME
    1.43 +#endif
    1.44 +
    1.45 +#define EMULATOR (defined(SYMBIAN) && (defined(__WINSCW__) || defined(__WINS__)))
    1.46 +#define GET_WSD_VAR_NAME(var,filename,prefix) 	_##prefix##_##filename##_##var
    1.47 +
    1.48 +#define RETURN_WSD_VAR(var,filename,prefix) (Libssl_ImpurePtr()->GET_WSD_VAR_NAME(var,filename,prefix))
    1.49 +
    1.50 +#define GET_WSD_VAR_FROM_TLS(var,filename,type,prefix)\
    1.51 +type *_##prefix##_##filename##_##var()\
    1.52 +{\
    1.53 +	return (&RETURN_WSD_VAR(var,filename,prefix));\
    1.54 +}
    1.55 +
    1.56 +#define GET_WSD_ARRAY_FROM_TLS(var,filename,type,prefix)\
    1.57 +type *_##prefix##_##filename##_##var()\
    1.58 +{\
    1.59 +	return (RETURN_WSD_VAR(var,filename,prefix));\
    1.60 +}
    1.61 +
    1.62 +#define VARIABLE_DECL(var,varprefix,filename,datatype)\
    1.63 +datatype GET_WSD_VAR_NAME(var,filename,varprefix);
    1.64 +
    1.65 +#define VARIABLE_DECL_ARRAY(name,varprefix,filename,datatype,size) \
    1.66 +datatype GET_WSD_VAR_NAME(name,filename,varprefix)[size];
    1.67 +
    1.68 +
    1.69 +#define GET_STATIC_VAR_FROM_TLS(var,filename,type) 		GET_WSD_VAR_FROM_TLS(var,filename,type,s)
    1.70 +
    1.71 +#define GET_GLOBAL_VAR_FROM_TLS(var,filename,type) 	GET_WSD_VAR_FROM_TLS(var,filename,type,g)
    1.72 +
    1.73 +#define GET_STATIC_ARRAY_FROM_TLS(var,filename,type) 	GET_WSD_ARRAY_FROM_TLS(var,filename,type,s)
    1.74 +
    1.75 +#define GET_GLOBAL_ARRAY_FROM_TLS(var,filename,type) 	GET_WSD_ARRAY_FROM_TLS(var,filename,type,g)
    1.76 +
    1.77 +
    1.78 +
    1.79 +#endif
    1.80 +#endif		//_LIBSSL_WSD_DEFS_H_