00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.accellera.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_cmnhdr.h - Common header file containing handy pragmas, macros and 00021 definitions common to all SystemC source files. 00022 00023 Original Author: Amit Rao, Synopsys, Inc. 00024 00025 CHANGE LOG AT THE END OF THE FILE 00026 *****************************************************************************/ 00027 00028 00029 #ifndef SC_CMNHDR_H 00030 #define SC_CMNHDR_H 00031 00032 // include useful platform information from Boost 00033 #include "sysc/packages/boost/config.hpp" 00034 00035 #if defined(_WIN32) || defined(_MSC_VER) || defined(__BORLANDC__) || \ 00036 defined(__MINGW32__) 00037 00038 // all windows 32-bit compilers should define WIN32 00039 #if !defined(WIN32) && !defined(WIN64) && !defined(_WIN64) 00040 #define WIN32 00041 #endif 00042 00043 // Windows Version Build Option 00044 #ifndef _WIN32_WINNT 00045 #define _WIN32_WINNT 0x0400 00046 #endif 00047 00048 // remember to later include windows.h, if needed 00049 #define SC_HAS_WINDOWS_H_ 00050 00051 #endif // WIN32 00052 00053 // ---------------------------------------------------------------------------- 00054 00055 #ifdef _MSC_VER 00056 00057 // Disable VC++ warnings that are harmless 00058 00059 // this : used in base member initializer list 00060 #pragma warning(disable: 4355) 00061 00062 // new and delete warning when exception handling is turned on 00063 #pragma warning(disable: 4291) 00064 00065 // in many places implicit conversion to bool 00066 // from other integral types is performed 00067 #pragma warning(disable: 4800) 00068 00069 // unary minus operator applied to unsigned 00070 #pragma warning(disable: 4146) 00071 00072 // multiple copy constructors 00073 #pragma warning(disable: 4521) 00074 00075 // identifier was truncated to '255' characters in the browser information 00076 #pragma warning(disable: 4786) 00077 00078 #endif 00079 00080 // ---------------------------------------------------------------------------- 00081 // helper macros to aid branch prediction on GCC (compatible) compilers 00082 00083 #ifndef __GNUC__ 00084 # define SC_LIKELY_( x ) !!(x) 00085 # define SC_UNLIKELY_( x ) !!(x) 00086 #else 00087 # define SC_LIKELY_( x ) __builtin_expect( !!(x), 1 ) 00088 # define SC_UNLIKELY_( x ) __builtin_expect( !!(x), 0 ) 00089 #endif 00090 00091 // ---------------------------------------------------------------------------- 00092 00093 #include <cassert> 00094 #include <cstdio> 00095 #include <cstdlib> 00096 00097 #endif // SC_CMNHDR_H 00098 00099 // ---------------------------------------------------------------------------- 00100 // only include Windows.h, if explicitly requested 00101 // (deliberately outside of include guards to enable later effect) 00102 #if defined(SC_HAS_WINDOWS_H_) && defined(SC_INCLUDE_WINDOWS_H) 00103 # undef SC_HAS_WINDOWS_H_ 00104 # include <Windows.h> 00105 #endif 00106 00107 // $Log: sc_cmnhdr.h,v $ 00108 // Revision 1.8 2011/08/26 20:46:09 acg 00109 // Andy Goodrich: moved the modification log to the end of the file to 00110 // eliminate source line number skew when check-ins are done. 00111 // 00112 // Revision 1.7 2011/05/09 04:07:48 acg 00113 // Philipp A. Hartmann: 00114 // (1) Restore hierarchy in all phase callbacks. 00115 // (2) Ensure calls to before_end_of_elaboration. 00116 // 00117 // Revision 1.6 2011/05/05 17:45:27 acg 00118 // Philip A. Hartmann: changes in WIN64 support. 00119 // Andy Goodrich: additional DEBUG_MSG instances to trace process handling. 00120 // 00121 // Revision 1.5 2011/02/18 20:27:14 acg 00122 // Andy Goodrich: Updated Copyrights. 00123 // 00124 // Revision 1.4 2011/02/13 21:47:37 acg 00125 // Andy Goodrich: update copyright notice. 00126 // 00127 // Revision 1.3 2009/05/22 16:06:29 acg 00128 // Andy Goodrich: process control updates. 00129 // 00130 // Revision 1.2 2008/05/22 17:06:24 acg 00131 // Andy Goodrich: updated copyright notice to include 2008. 00132 // 00133 // Revision 1.1.1.1 2006/12/15 20:20:05 acg 00134 // SystemC 2.3 00135 // 00136 // Revision 1.3 2006/01/13 18:44:29 acg 00137 // Added $Log to record CVS changes into the source. 00138 00139 // Taf!