API.h

Go to the documentation of this file.
00001 #ifndef __LDK_API_H__
00002 #define __LDK_API_H__
00003 
00005 //   Copyright (C) 2003-2006 Lorien Dunn.
00006 //
00007 //   Contact: loriendunn AT users DOT sourceforge DOT net
00008 //
00009 //   This software is provided 'as-is', without any express or implied warranty.
00010 //   In no event will the authors be held liable for any damages arising from
00011 //   the use of this software.
00012 //
00013 //   Permission is granted to anyone to use this software for any purpose,
00014 //   including commercial applications, and to alter it and redistribute it
00015 //   freely, subject to the following restrictions:
00016 //
00017 //   1. The origin of this software must not be misrepresented; you must not
00018 //   claim that you wrote the original software. If you use this software in a
00019 //   product, an acknowledgment in the product documentation would be
00020 //   appreciated but is not required.
00021 //
00022 //   2. Altered source versions must be plainly marked as such, and must not be
00023 //   misrepresented as being the original software.
00024 //
00025 //   3. This notice may not be removed or altered from any source distribution.
00026 //
00028 
00033 #if defined WIN32 || defined _WIN64 || defined _W64
00034 #ifndef _WINDOWS
00035 #define _WINDOWS
00036 #if defined( _DEBUG ) && !defined( DEBUG )
00037 #define DEBUG
00038 #endif //defined( _DEBUG ) && !defined( DEBUG )
00039 #endif //_WINDOWS
00040 #ifdef _MSC_VER
00041 //#pragma warning (disable : 4231) //exporting templates warning
00042 #pragma warning (disable : 4996) //CRT deprecated warning
00043 #endif //_MSC_VER
00044 #endif //WIN32
00045 
00046 #ifdef _WINDOWS
00047     #define DLLIMPORT __declspec(dllimport)
00048     #define DLLEXPORT __declspec(dllexport)
00049     #ifdef LDK_STATIC
00050         #define LDK_API
00051         #ifdef LDK_EXPORT
00052             #define LDK_TLS_API DLLEXPORT
00053         #else
00054             #define LDK_TLS_API DLLIMPORT
00055         #endif //LDK_EXPORT
00056     #else //building dynamic lib
00057         #ifdef LDK_EXPORT
00058             #define LDK_API DLLEXPORT
00059             #define LDK_TLS_API DLLEXPORT
00060         #else
00061             #define LDK_API DLLIMPORT
00062             #define LDK_TLS_API DLLIMPORT
00063         #endif //LDK_EXPORT
00064     #endif //LDK_STATIC
00065 #else 
00066     #define DLLIMPORT
00067     #define DLLEXPORT
00068     #define LDK_API
00069     #define LDK_TLS_API
00070 #endif //_WINDOWS
00071 
00072 //I wish sizeof would work in the preprocessor!
00073 #ifdef _WINDOWS
00074 #ifdef WIN32
00075     #define THIRTY_TWO_BIT 1
00076     #elif defined (_WIN64) || defined _W64
00077     #define SIXTY_FOUR_BIT 1
00078 #endif //WIN32
00079 #elif defined unix
00080 //this could really do with more 64-bit architecture
00081 //detection, but I don't know the values...
00082 #if defined(__x86_64__) || defined (__ia64__)
00083     #define SIXTY_FOUR_BIT 1
00084 #else
00085     #define THIRTY_TWO_BIT 1
00086 #endif //defined(__x86_64__) || defined (__ia64__)
00087 #ifdef __GNUC__
00088 #define ALIGNED16 __attribute__ ((aligned(16)))
00089 #elif defined _MSC_VER
00090 #define ALIGNED16 __declspec(align(16))
00091 #endif //__GNUC__
00092 #endif //_WINDOWS
00093 
00094 
00095 #endif //__LDK_API_H__

Generated on Fri Aug 17 18:32:26 2007 for LDK by  doxygen 1.5.1