--- orig/__glpk__.cc 2007-02-18 18:17:50.000000000 +0100 +++ new/__glpk__.cc 2007-02-19 02:32:27.000000000 +0100 @@ -38,17 +38,10 @@ #if defined (HAVE_GLPK) -extern "C" { #include -#ifndef _GLPLIB_H -#include -#endif -#ifndef lib_set_fault_hook -#define lib_set_fault_hook lib_fault_hook -#endif -#ifndef lib_set_print_hook -#define lib_set_print_hook lib_print_hook -#endif +extern "C" { +void _glp_lib_print_hook(int (*func)(void *info, char *buf), void *info); +void _glp_lib_fault_hook(int (*func)(void *info, char *buf), void *info); } #define NIntP 17 @@ -150,10 +143,10 @@ clock_t t_start = clock(); - lib_set_fault_hook (NULL, glpk_fault_hook); + _glp_lib_fault_hook (glpk_fault_hook, NULL); if (lpxIntParam[0] > 1) - lib_set_print_hook (NULL, glpk_print_hook); + _glp_lib_print_hook (glpk_print_hook, NULL); LPX *lp = lpx_create_prob (); @@ -286,7 +279,7 @@ break; default: - insist (method != method); + glpk_fault_hook (NULL, "method != method"); } /* errnum assumes the following results: @@ -351,7 +344,8 @@ } *time = (clock () - t_start) / CLOCKS_PER_SEC; - *mem = (lib_env_ptr () -> mem_tpeak); + /* currently there is no way to determine memory usage */ + *mem = 0; lpx_delete_prob (lp); return 0;