1 /* portab_a.h -- advanced portability layer
3 This file is part of the LZO real-time data compression library.
5 Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
6 Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
7 Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
8 Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
9 Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
10 Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
11 Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
12 Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
13 Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
14 Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
15 Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
16 Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
17 Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
18 Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
19 Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
20 Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
23 The LZO library is free software; you can redistribute it and/or
24 modify it under the terms of the GNU General Public License as
25 published by the Free Software Foundation; either version 2 of
26 the License, or (at your option) any later version.
28 The LZO library is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 GNU General Public License for more details.
33 You should have received a copy of the GNU General Public License
34 along with the LZO library; see the file COPYING.
35 If not, write to the Free Software Foundation, Inc.,
36 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
38 Markus F.X.J. Oberhumer
39 <markus@oberhumer.com>
40 http://www.oberhumer.com/opensource/lzo/
44 /*************************************************************************
45 // use the ACC library for the hard work
46 **************************************************************************/
48 #if defined(LZO_HAVE_CONFIG_H)
49 # define ACC_CONFIG_NO_HEADER 1
52 #define ACC_WANT_ACC_INCD_H 1
53 #define ACC_WANT_ACC_INCE_H 1
54 #if defined(__LZO_MMODEL_HUGE) || defined(ACC_WANT_ACCLIB_GETOPT) || defined(WANT_LZO_UCLOCK) || defined(WANT_LZO_WILDARGV)
55 # define ACC_WANT_ACC_INCI_H 1
56 # define ACC_WANT_ACC_LIB_H 1
58 #include "src/miniacc.h"
60 #if defined(WANT_LZO_MALLOC)
61 # if defined(__LZO_MMODEL_HUGE)
62 # define ACC_WANT_ACCLIB_HALLOC 1
64 # define acc_halloc(a) (malloc(a))
65 # define acc_hfree(a) (free(a))
68 #if defined(WANT_LZO_FREAD)
69 # if defined(__LZO_MMODEL_HUGE)
70 # define ACC_WANT_ACCLIB_HFREAD 1
72 # define acc_hfread(f,b,s) (fread(b,1,s,f))
73 # define acc_hfwrite(f,b,s) (fwrite(b,1,s,f))
76 #if defined(WANT_LZO_UCLOCK)
77 # define ACC_WANT_ACCLIB_PCLOCK 1
78 # if 0 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
79 # define __ACCLIB_PCLOCK_USE_RDTSC 1
80 # define ACC_WANT_ACCLIB_RDTSC 1
83 #if defined(WANT_LZO_WILDARGV)
84 # define ACC_WANT_ACCLIB_WILDARGV 1
86 #if (__ACCLIB_REQUIRE_HMEMCPY_CH) && !defined(__ACCLIB_HMEMCPY_CH_INCLUDED)
87 # define ACC_WANT_ACCLIB_HMEMCPY 1
89 #include "src/miniacc.h"
92 /*************************************************************************
93 // finally pull into the LZO namespace
94 **************************************************************************/
100 #if defined(WANT_LZO_MALLOC)
101 # if defined(acc_halloc)
102 # define lzo_malloc(a) acc_halloc(a)
104 # define lzo_malloc(a) __ACCLIB_FUNCNAME(acc_halloc)(a)
106 # if defined(acc_hfree)
107 # define lzo_free(a) acc_hfree(a)
109 # define lzo_free(a) __ACCLIB_FUNCNAME(acc_hfree)(a)
112 #if defined(WANT_LZO_FREAD)
113 # if defined(acc_hfread)
114 # define lzo_fread(f,b,s) acc_hfread(f,b,s)
116 # define lzo_fread(f,b,s) __ACCLIB_FUNCNAME(acc_hfread)(f,b,s)
118 # if defined(acc_hfwrite)
119 # define lzo_fwrite(f,b,s) acc_hfwrite(f,b,s)
121 # define lzo_fwrite(f,b,s) __ACCLIB_FUNCNAME(acc_hfwrite)(f,b,s)
124 #if defined(WANT_LZO_UCLOCK)
125 # define lzo_uclock_handle_t acc_pclock_handle_t
126 # define lzo_uclock_t acc_pclock_t
127 # define lzo_uclock_open(a) __ACCLIB_FUNCNAME(acc_pclock_open_default)(a)
128 # define lzo_uclock_close(a) __ACCLIB_FUNCNAME(acc_pclock_close)(a)
129 # define lzo_uclock_read(a,b) __ACCLIB_FUNCNAME(acc_pclock_read)(a,b)
130 # define lzo_uclock_get_elapsed(a,b,c) __ACCLIB_FUNCNAME(acc_pclock_get_elapsed)(a,b,c)
132 #if defined(WANT_LZO_WILDARGV)
133 # define lzo_wildargv(a,b) __ACCLIB_FUNCNAME(acc_wildargv)(a,b)