]> git.mxchange.org Git - simgear.git/blob - simgear/math/fg_memory.h
Added simgear/magvar which impliments WMM 2000 world magnetic variance model.
[simgear.git] / simgear / math / fg_memory.h
1 // fg_memory.h -- memcpy/bcopy portability declarations
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License as
5 // published by the Free Software Foundation; either version 2 of the
6 // License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 //
17 // $Id$
18
19
20 #ifndef _FG_MEMORY_H
21 #define _FG_MEMORY_H
22
23 #ifdef HAVE_CONFIG_H
24 #  include <config.h>
25 #endif
26
27 #ifdef HAVE_MEMCPY
28
29 #  ifdef HAVE_MEMORY_H
30 #    include <memory.h>
31 #  endif
32
33 #  define fgmemcmp            memcmp
34 #  define fgmemcpy            memcpy
35 #  define fgmemzero(dest,len) memset(dest,0,len)
36
37 #elif defined(HAVE_BCOPY)
38
39 #  define fgmemcmp              bcmp
40 #  define fgmemcpy(dest,src,n)  bcopy(src,dest,n)
41 #  define fgmemzero             bzero
42
43 #else
44
45 /* 
46  * Neither memcpy() or bcopy() available.
47  * Use substitutes provided be zlib.
48  */
49
50 #  include <zutil.h>
51 #  define fgmemcmp zmemcmp
52 #  define fgmemcpy zmemcpy
53 #  define fgmemzero zmemzero
54
55 #endif
56
57 #endif // _FG_MEMORY_H
58
59