00001 #ifndef _FV_COMPILER_H_
00002 #define _FV_COMPILER_H_
00003 #define _CRTDBG_MAP_ALLOC
00004 #include <stdlib.h>
00005 #include "fv_config.h"
00006
00007 #ifdef WIN32
00008 # define WINDOWS_LEAN_AND_MEAN
00009 # include<windows.h>
00010 # include <crtdbg.h>
00011 #else
00012 #include<sys/types.h>
00013 #include<dlfcn.h>
00014 #endif
00015
00016 #ifdef WIN32
00017 # ifndef fun_call
00018 # define fun_call _cdecl
00019 # endif
00020 # ifndef std_call
00021 # define std_call _stdcall
00022 # endif
00023 #else
00024 # define fun_call
00025 # define std_call
00026 #endif
00027
00028 #if defined(WIN32) && defined(_MSC_VER)
00029 # pragma warning(disable: 4996)
00030 #endif
00031
00032 #include<cassert>
00033 #include<stdexcept>
00034
00035 typedef unsigned int uint_t;
00036 typedef unsigned char ubyte_t;
00037 typedef unsigned char uint8_t;
00038 typedef long int long_t;
00039 typedef unsigned long ulong_t;
00040
00041 typedef unsigned int id_t;
00042 typedef int size_type;
00043
00044 #ifndef __uint32_t_defined
00045 typedef unsigned int uint32_t;
00046 # define __uint32_t_defined
00047 #endif
00048
00049 #ifdef _USE_FV_LIB
00050 # ifndef fv_const_t
00051 # define fv_const_t const
00052 # endif
00053 #else
00054 # define fv_const_t
00055 #endif
00056
00057
00058 typedef int (fun_call *fv_const_t intfint)(int);
00059 typedef int (fun_call *fv_const_t intfcharp)(char*);
00060 typedef int (fun_call *fv_const_t intf2int)(int,int);
00061 typedef int (fun_call *fv_const_t intf2intintp)(int,int,int*);
00062 typedef int (fun_call *fv_const_t intf2int2intp)(int,int,int*,int*);
00063 typedef int (fun_call *fv_const_t intf2intintpdoublep)(int,int,int*,double*);
00064 typedef void (fun_call *fv_const_t voidf2int4intp2doublep)(int,int,
00065 int*,int*,int*,int*,double*,double*);
00066 typedef int (fun_call *fv_const_t intf2intdoublep)(int,int,double*);
00067 typedef int (fun_call *fv_const_t intfintcharp)(int,char*);
00068 typedef int (fun_call *fv_const_t intf3intdoublep)(int,int,int,double*);
00069 typedef void (fun_call *fv_const_t voidf2int3intp)(int,int,int*,int*,int*);
00070
00071 typedef int (fun_call *fv_const_t int_global_solutiom)(int,double*,int,int*,double*,double*,double*,double*,double*,int);
00072 typedef double (fun_call *fv_const_t double_el_calc)(int,int,int*,int,
00073 double*,double*,double*,double*,double*,double*,double*,
00074 double*,double*,double*,double*,double*,double*);
00075 typedef int (fun_call *fv_const_t intfchar5intcharpfnp)(char,int,int,int,int,int,char*,double(*)(int,double*,int));
00076 typedef int (fun_call *fv_const_t intfintcharpfilep)(int,char*,FILE*);
00077
00078
00079 #define FV_STATIC_ASSERT(Type,Num) \
00080 static_assert( sizeof(Type) == sizeof(int) * Num \
00081 , \
00082 "Type does not satisfy contiguous storage requirements")
00083
00084 #endif
00085