build all (32 64 GMP) lib versions by default if none specified
[polylib.git] / mp_get_memory_functions.c
blob167c24dae3f44ba91d18a3935bfa264b207bcd13
1 /*
2 This file is part of PolyLib.
4 PolyLib is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 PolyLib is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with PolyLib. If not, see <http://www.gnu.org/licenses/>.
17 #include <gmp.h>
19 void mp_get_memory_functions(
20 void *(**alloc_func_ptr) (size_t),
21 void *(**realloc_func_ptr) (void *, size_t, size_t),
22 void (**free_func_ptr) (void *, size_t))
24 if (alloc_func_ptr)
25 *alloc_func_ptr = __gmp_allocate_func;
26 if (realloc_func_ptr)
27 *realloc_func_ptr = __gmp_reallocate_func;
28 if (free_func_ptr)
29 *free_func_ptr = __gmp_free_func;