gwenhywfar
4.3.3
|
00001 /*************************************************************************** 00002 $RCSfile$ 00003 ------------------- 00004 cvs : $Id$ 00005 begin : Wed Sep 02 2002 00006 copyright : (C) 2002 by Martin Preuss 00007 email : martin@libchipcard.de 00008 00009 *************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00024 * MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 #ifndef GWENHYWFARAPI_H 00029 #define GWENHYWFARAPI_H 00030 00031 #include <gwenhywfar/types.h> 00032 00033 #ifdef GWENHYWFAR_IS_SUBPROJECT 00034 # define GWENHYWFAR_API 00035 # define GWENHYWFAR_EXPORT 00036 # define GWENHYWFAR_NOEXPORT 00037 # define GWEN_UNUSED 00038 #else 00039 # ifdef BUILDING_GWENHYWFAR 00040 /* building Gwenhywfar */ 00041 # if GWENHYWFAR_SYS_IS_WINDOWS 00042 /* for windows */ 00043 # ifdef __declspec 00044 # define GWENHYWFAR_API __declspec (dllexport) 00045 # else /* if __declspec */ 00046 # define GWENHYWFAR_API 00047 # endif /* if NOT __declspec */ 00048 # else 00049 /* for non-win32 */ 00050 # ifdef GCC_WITH_VISIBILITY_ATTRIBUTE 00051 # define GWENHYWFAR_API __attribute__((visibility("default"))) 00052 # else 00053 # define GWENHYWFAR_API 00054 # endif 00055 # endif 00056 # else 00057 /* not building Gwenhywfar */ 00058 # if GWENHYWFAR_SYS_IS_WINDOWS 00059 /* for windows */ 00060 # ifdef __declspec 00061 # define GWENHYWFAR_API __declspec (dllimport) 00062 # else /* if __declspec */ 00063 # define GWENHYWFAR_API 00064 # endif /* if NOT __declspec */ 00065 # else 00066 /* for non-win32 */ 00067 # define GWENHYWFAR_API 00068 # endif 00069 # endif 00070 00071 # ifdef GCC_WITH_VISIBILITY_ATTRIBUTE 00072 # define GWENHYWFAR_EXPORT __attribute__((visibility("default"))) 00073 # define GWENHYWFAR_NOEXPORT __attribute__((visibility("hidden"))) 00074 # else 00075 # define GWENHYWFAR_EXPORT 00076 # define GWENHYWFAR_NOEXPORT 00077 # endif 00078 00079 # ifdef __GNUC__ 00080 # define GWEN_UNUSED __attribute__((unused)) 00081 # else 00082 # define GWEN_UNUSED 00083 # endif 00084 #endif 00085 00086 #if GWENHYWFAR_SYS_IS_WINDOWS 00087 # define GWENHYWFAR_CB __stdcall 00088 #else 00089 # define GWENHYWFAR_CB 00090 #endif 00091 00092 #if GWENHYWFAR_SYS_IS_WINDOWS 00093 # define GWEN_DIR_SEPARATOR '\\' 00094 # define GWEN_DIR_SEPARATOR_S "\\" 00095 # define GWEN_SEARCHPATH_SEPARATOR ';' 00096 # define GWEN_SEARCHPATH_SEPARATOR_S ";" 00097 #else 00098 00100 # define GWEN_DIR_SEPARATOR '/' 00101 00103 # define GWEN_DIR_SEPARATOR_S "/" 00104 00106 # define GWEN_SEARCHPATH_SEPARATOR ':' 00107 00109 # define GWEN_SEARCHPATH_SEPARATOR_S ":" 00110 #endif 00111 00112 00113 /* Convenience macros to test the versions of glibc and gcc. Taken 00114 from <features.h> which does not contain this on MinGW systems. */ 00115 #ifndef __GNUC_PREREQ 00116 # if defined __GNUC__ && defined __GNUC_MINOR__ 00117 # define __GNUC_PREREQ(maj, min) \ 00118 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 00119 # else 00120 # define __GNUC_PREREQ(maj, min) 0 00121 # endif 00122 #endif /* __GNUC_PREREQ */ 00123 00124 00125 /* Taken from <sys/cdefs.h> which does not contain this on MinGW 00126 systems. */ 00127 #ifndef __STRING 00128 # define __STRING(x) #x 00129 #endif /* __STRING */ 00130 00131 00132 /* This is needed for PalmOS, because it define some functions needed */ 00133 #include <string.h> 00134 #include <gwenhywfar/system.h> 00135 00136 00137 #if __GNUC_PREREQ(3, 0) 00138 /* Only available in gcc >= 3.0.x */ 00139 # define DEPRECATED __attribute__((deprecated)) 00140 # define GWEN_LIKELY(cond) __builtin_expect(!!(cond), 1) 00141 # define GWEN_UNLIKELY(cond) __builtin_expect(!!(cond), 0) 00142 #else 00143 # define DEPRECATED 00144 # define GWEN_LIKELY(cond) (!!(cond)) 00145 # define GWEN_UNLIKELY(cond) (!!(cond)) 00146 #endif /* __GNUC__ */ 00147 00148 00149 #define GWEN_TIMEOUT_NONE (0) 00150 #define GWEN_TIMEOUT_FOREVER (-1) 00151 00152 00153 #endif 00154 00155