2 Copyright (C) 2016 Ben Kibbey <bjk@luxsci.net>
4 This file is part of libpwmd.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
29 /* To avoid that a compiler optimizes certain memset calls away, these
30 macros may be used instead. Thanks g10Code. */
31 #define wipememory(_ptr,_set,_len) do { \
32 volatile char *_vptr=(volatile char *)(_ptr); \
33 size_t _vlen=(_len); \
34 while(_vlen) { *_vptr=(_set); _vptr++; _vlen--; } \
44 #define _xmalloc malloc
45 #define _xrealloc realloc
46 #define _xcalloc calloc
47 void *xrealloc_gpgrt (void *, size_t);
49 void _xfree (void *ptr
)
50 __attribute__ ((visibility ("hidden")));
51 void *_xmalloc (size_t size
)
52 __attribute__ ((visibility ("hidden")));
53 void *_xrealloc (void *ptr
, size_t size
)
54 __attribute__ ((visibility ("hidden")));
55 void *_xcalloc (size_t nmemb
, size_t size
)
56 __attribute__ ((visibility ("hidden")));
57 void *_xrealloc_gpgrt (void *, size_t)
58 __attribute__ ((visibility ("hidden")));