00001 #ifndef Impala_Core_Array_Element_CheckNativeTypeSize_h
00002 #define Impala_Core_Array_Element_CheckNativeTypeSize_h
00003
00004 #include "Basis/NativeTypes.h"
00005 #include "Basis/ILog.h"
00006
00007 namespace Impala
00008 {
00009 namespace Core
00010 {
00011 namespace Array
00012 {
00013 namespace Element
00014 {
00015
00016
00017 inline bool
00018 CheckNativeTypeSize()
00019 {
00020 ILOG_VAR(Core.Array.Element.CheckNativeTypeSize);
00021 ILOG_DEBUG("sizeof Int8 = " << sizeof(Int8));
00022 if (sizeof(Int8) != 1)
00023 {
00024 ILOG_ERROR("sizeof Int8 = " << sizeof(Int8) << " (should be 1)");
00025 return false;
00026 }
00027 ILOG_DEBUG("sizeof Int16 = " << sizeof(Int16));
00028 if (sizeof(Int16) != 2)
00029 {
00030 ILOG_ERROR("sizeof Int16 = " << sizeof(Int16) << " (should be 2)");
00031 return false;
00032 }
00033 ILOG_DEBUG("sizeof Int32 = " << sizeof(Int32));
00034 if (sizeof(Int32) != 4)
00035 {
00036 ILOG_ERROR("sizeof Int32 = " << sizeof(Int32) << " (should be 4)");
00037 return false;
00038 }
00039 ILOG_DEBUG("sizeof Int64 = " << sizeof(Int64));
00040 if (sizeof(Int64) != 8)
00041 {
00042 ILOG_ERROR("sizeof Int64 = " << sizeof(Int64) << " (should be 8)");
00043 return false;
00044 }
00045 ILOG_DEBUG("sizeof Real32 = " << sizeof(Real32));
00046 if (sizeof(Real32) != 4)
00047 {
00048 ILOG_ERROR("sizeof Real32 = " << sizeof(Real32) << " (should be 4)");
00049 return false;
00050 }
00051 ILOG_DEBUG("sizeof Real64 = " << sizeof(Real64));
00052 if (sizeof(Real64) != 8)
00053 {
00054 ILOG_ERROR("sizeof Real64 = " << sizeof(Real64) << " (should be 8)");
00055 return false;
00056 }
00057 ILOG_INFO("sizeof size_t = " << sizeof(size_t));
00058 return true;
00059 }
00060
00061 }
00062 }
00063 }
00064 }
00065
00066 #endif