support.hh
Go to the documentation of this file.00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 00002 /* 00003 * Main authors: 00004 * Christian Schulte <schulte@gecode.org> 00005 * 00006 * Copyright: 00007 * Christian Schulte, 2007 00008 * 00009 * This file is part of Gecode, the generic constraint 00010 * development environment: 00011 * http://www.gecode.org 00012 * 00013 * Permission is hereby granted, free of charge, to any person obtaining 00014 * a copy of this software and associated documentation files (the 00015 * "Software"), to deal in the Software without restriction, including 00016 * without limitation the rights to use, copy, modify, merge, publish, 00017 * distribute, sublicense, and/or sell copies of the Software, and to 00018 * permit persons to whom the Software is furnished to do so, subject to 00019 * the following conditions: 00020 * 00021 * The above copyright notice and this permission notice shall be 00022 * included in all copies or substantial portions of the Software. 00023 * 00024 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00025 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00026 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00027 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 00028 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 00029 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00030 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00031 * 00032 */ 00033 00034 #ifndef __GECODE_SUPPORT_HH__ 00035 #define __GECODE_SUPPORT_HH__ 00036 00037 #include <cassert> 00038 00039 #include <gecode/support/config.hpp> 00040 00041 /* 00042 * Linking and compiler workarounds 00043 * 00044 */ 00045 #if !defined(GECODE_STATIC_LIBS) && \ 00046 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER)) 00047 00054 #define GECODE_MSC_VIRTUAL virtual 00055 00056 #ifdef GECODE_BUILD_SUPPORT 00057 #define GECODE_SUPPORT_EXPORT __declspec( dllexport ) 00058 #else 00059 #define GECODE_SUPPORT_EXPORT __declspec( dllimport ) 00060 #endif 00061 #define GECODE_VTABLE_EXPORT 00062 00063 #else 00064 00065 #define GECODE_MSC_VIRTUAL 00066 00067 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY 00068 #define GECODE_SUPPORT_EXPORT __attribute__ ((visibility("default"))) 00069 #define GECODE_VTABLE_EXPORT __attribute__ ((visibility("default"))) 00070 #else 00071 #define GECODE_SUPPORT_EXPORT 00072 #define GECODE_VTABLE_EXPORT 00073 #endif 00074 00075 #endif 00076 00077 // Configure auto-linking 00078 #ifndef GECODE_BUILD_SUPPORT 00079 #define GECODE_LIBRARY_NAME "Support" 00080 #include <gecode/support/auto-link.hpp> 00081 #endif 00082 00083 // Configure threads 00084 #ifdef GECODE_THREADS_WINDOWS 00085 #define GECODE_HAS_THREADS 00086 #endif 00087 00088 #ifdef GECODE_THREADS_PTHREADS 00089 #define GECODE_HAS_THREADS 00090 #endif 00091 00092 00093 /* 00094 * Basic support needed everywhere 00095 * 00096 */ 00097 00098 #include <gecode/support/macros.hpp> 00099 #include <gecode/support/exception.hpp> 00100 #include <gecode/support/cast.hpp> 00101 #include <gecode/support/hash.hpp> 00102 #include <gecode/support/thread.hpp> 00103 #include <gecode/support/allocator.hpp> 00104 #include <gecode/support/heap.hpp> 00105 #include <gecode/support/marked-pointer.hpp> 00106 #include <gecode/support/int-type.hpp> 00107 00108 /* 00109 * Common datastructures and algorithms 00110 * 00111 */ 00112 00113 #include <gecode/support/bitset-base.hpp> 00114 #include <gecode/support/bitset.hpp> 00115 #include <gecode/support/bitset-offset.hpp> 00116 #include <gecode/support/block-allocator.hpp> 00117 #include <gecode/support/dynamic-array.hpp> 00118 #include <gecode/support/dynamic-queue.hpp> 00119 #include <gecode/support/dynamic-stack.hpp> 00120 #include <gecode/support/random.hpp> 00121 #include <gecode/support/sort.hpp> 00122 #include <gecode/support/static-stack.hpp> 00123 00124 00125 /* 00126 * Operating system support 00127 * 00128 */ 00129 00130 #ifdef GECODE_THREADS_WINDOWS 00131 #include <gecode/support/thread/windows.hpp> 00132 #endif 00133 #ifdef GECODE_THREADS_PTHREADS 00134 #include <gecode/support/thread/pthreads.hpp> 00135 #endif 00136 #ifndef GECODE_HAS_THREADS 00137 #include <gecode/support/thread/none.hpp> 00138 #endif 00139 00140 #include <gecode/support/thread/thread.hpp> 00141 00142 #include <gecode/support/ref-count.hpp> 00143 00144 #include <gecode/support/timer.hpp> 00145 #include <gecode/support/hw-rnd.hpp> 00146 00147 /* 00148 * Miscellaneous 00149 * 00150 */ 00151 00152 #include <gecode/support/run-jobs.hpp> 00153 00154 #endif 00155 00156 // STATISTICS: support-any