Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / lzo / examples / portab_a.h
blob2706022d532e68b6020203267f24ab4bf243f4a8
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
21 All Rights Reserved.
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
50 #endif
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
57 #endif
58 #include "src/miniacc.h"
60 #if defined(WANT_LZO_MALLOC)
61 # if defined(__LZO_MMODEL_HUGE)
62 # define ACC_WANT_ACCLIB_HALLOC 1
63 # else
64 # define acc_halloc(a) (malloc(a))
65 # define acc_hfree(a) (free(a))
66 # endif
67 #endif
68 #if defined(WANT_LZO_FREAD)
69 # if defined(__LZO_MMODEL_HUGE)
70 # define ACC_WANT_ACCLIB_HFREAD 1
71 # else
72 # define acc_hfread(f,b,s) (fread(b,1,s,f))
73 # define acc_hfwrite(f,b,s) (fwrite(b,1,s,f))
74 # endif
75 #endif
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
81 # endif
82 #endif
83 #if defined(WANT_LZO_WILDARGV)
84 # define ACC_WANT_ACCLIB_WILDARGV 1
85 #endif
86 #if (__ACCLIB_REQUIRE_HMEMCPY_CH) && !defined(__ACCLIB_HMEMCPY_CH_INCLUDED)
87 # define ACC_WANT_ACCLIB_HMEMCPY 1
88 #endif
89 #include "src/miniacc.h"
92 /*************************************************************************
93 // finally pull into the LZO namespace
94 **************************************************************************/
96 #undef lzo_malloc
97 #undef lzo_free
98 #undef lzo_fread
99 #undef lzo_fwrite
100 #if defined(WANT_LZO_MALLOC)
101 # if defined(acc_halloc)
102 # define lzo_malloc(a) acc_halloc(a)
103 # else
104 # define lzo_malloc(a) __ACCLIB_FUNCNAME(acc_halloc)(a)
105 # endif
106 # if defined(acc_hfree)
107 # define lzo_free(a) acc_hfree(a)
108 # else
109 # define lzo_free(a) __ACCLIB_FUNCNAME(acc_hfree)(a)
110 # endif
111 #endif
112 #if defined(WANT_LZO_FREAD)
113 # if defined(acc_hfread)
114 # define lzo_fread(f,b,s) acc_hfread(f,b,s)
115 # else
116 # define lzo_fread(f,b,s) __ACCLIB_FUNCNAME(acc_hfread)(f,b,s)
117 # endif
118 # if defined(acc_hfwrite)
119 # define lzo_fwrite(f,b,s) acc_hfwrite(f,b,s)
120 # else
121 # define lzo_fwrite(f,b,s) __ACCLIB_FUNCNAME(acc_hfwrite)(f,b,s)
122 # endif
123 #endif
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)
131 #endif
132 #if defined(WANT_LZO_WILDARGV)
133 # define lzo_wildargv(a,b) __ACCLIB_FUNCNAME(acc_wildargv)(a,b)
134 #endif
138 vi:ts=4:et