![]() |
Helixis 1.0
Task Programming API
|
00001 /* 00002 ** Copyright 2009-2011, helixis.org 00003 ** All rights reserved. 00004 ** 00005 ** Redistribution and use in source and binary forms, with or without modification, are permitted provided 00006 ** that the following conditions are met: 00007 ** 00008 ** Redistributions of source code must retain the above copyright notice, this list of conditions and the 00009 ** following disclaimer. 00010 ** 00011 ** Redistributions in binary form must reproduce the above copyright notice, this list of conditions and 00012 ** the following disclaimer in the documentation and/or other materials provided with the distribution. 00013 ** 00014 ** Neither the name of the helixis.org nor the names of its contributors may be used to endorse or promote 00015 ** products derived from this software without specific prior written permission. 00016 ** 00017 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 00018 ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00019 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 00020 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 00021 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00022 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00023 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00024 ** POSSIBILITY OF SUCH DAMAGE. 00025 */ 00026 00027 #ifndef __HLX_ATOMIC_H__ 00028 # define __HLX_ATOMIC_H__ 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 /* 00035 ** TYPES & MACROS 00036 */ 00037 00038 #if (defined(PLATFORM_WIN_64) && !defined(WIN_KERNEL_BUILD)) 00039 typedef unsigned __int64 atom_t; 00040 # define ALIGN_SINGLE_POINTER 8 00041 # define ALIGN_DOUBLE_POINTER 16 00042 #elif (defined PLATFORM_WIN_32 && !(defined WIN_KERNEL_BUILD)) 00043 typedef unsigned long int atom_t; 00044 # define ALIGN_SINGLE_POINTER 4 00045 # define ALIGN_DOUBLE_POINTER 8 00046 #elif (defined(PLATFORM_WIN_64) && defined(WIN_KERNEL_BUILD)) 00047 typedef unsigned __int64 atom_t; 00048 # define ALIGN_SINGLE_POINTER 8 00049 # define ALIGN_DOUBLE_POINTER 16 00050 #elif (defined(PLATFORM_WIN_32) && defined(WIN_KERNEL_BUILD)) 00051 typedef unsigned long int atom_t; 00052 # define ALIGN_SINGLE_POINTER 4 00053 # define ALIGN_DOUBLE_POINTER 8 00054 #elif (defined __unix__ && defined __x86_64__ && COMPILER_GNUC) || defined(PLATFORM_MACOS_64)) 00055 typedef unsigned long long int atom_t; 00056 # define ALIGN_SINGLE_POINTER 8 00057 # define ALIGN_DOUBLE_POINTER 16 00058 #elif ((defined __unix__ && defined __i686__ && COMPILER_GNUC) && !defined(__arm__)) || defined(PLATFORM_MACOS_32)) 00059 typedef unsigned long int atom_t; 00060 # define ALIGN_SINGLE_POINTER 4 00061 # define ALIGN_DOUBLE_POINTER 8 00062 #elif (defined __unix__ && defined __arm__ && COMPILER_GNUC) || defined(PLATFORM_NDS) 00063 typedef unsigned long int atom_t; 00064 # define ALIGN_SINGLE_POINTER 4 00065 # define ALIGN_DOUBLE_POINTER 8 00066 #elif defined(PLATFORM_IPHONE) || defined(PLATFORM_ANDROID) 00067 typedef unsigned long int atom_t; 00068 # define ALIGN_SINGLE_POINTER 4 00069 # define ALIGN_DOUBLE_POINTER 8 00070 #else 00071 typedef unsigned long int atom_t; 00072 # define ALIGN_SINGLE_POINTER 4 00073 # define ALIGN_DOUBLE_POINTER 8 00074 #endif 00075 00076 #ifdef __cplusplus 00077 } 00078 #endif 00079 00080 #endif /* !__HLX_ATOMIC_H__ */ 00081 00082 /* 00083 ** END OF FILE 00084 */