xref: /aosp_15_r20/external/libjpeg-turbo/tjutil.h (revision dfc6aa5c1cfd4bc4e2018dc74aa96e29ee49c6da)
1*dfc6aa5cSAndroid Build Coastguard Worker /*
2*dfc6aa5cSAndroid Build Coastguard Worker  * Copyright (C)2011, 2022 D. R. Commander.  All Rights Reserved.
3*dfc6aa5cSAndroid Build Coastguard Worker  *
4*dfc6aa5cSAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
5*dfc6aa5cSAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions are met:
6*dfc6aa5cSAndroid Build Coastguard Worker  *
7*dfc6aa5cSAndroid Build Coastguard Worker  * - Redistributions of source code must retain the above copyright notice,
8*dfc6aa5cSAndroid Build Coastguard Worker  *   this list of conditions and the following disclaimer.
9*dfc6aa5cSAndroid Build Coastguard Worker  * - Redistributions in binary form must reproduce the above copyright notice,
10*dfc6aa5cSAndroid Build Coastguard Worker  *   this list of conditions and the following disclaimer in the documentation
11*dfc6aa5cSAndroid Build Coastguard Worker  *   and/or other materials provided with the distribution.
12*dfc6aa5cSAndroid Build Coastguard Worker  * - Neither the name of the libjpeg-turbo Project nor the names of its
13*dfc6aa5cSAndroid Build Coastguard Worker  *   contributors may be used to endorse or promote products derived from this
14*dfc6aa5cSAndroid Build Coastguard Worker  *   software without specific prior written permission.
15*dfc6aa5cSAndroid Build Coastguard Worker  *
16*dfc6aa5cSAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
17*dfc6aa5cSAndroid Build Coastguard Worker  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*dfc6aa5cSAndroid Build Coastguard Worker  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*dfc6aa5cSAndroid Build Coastguard Worker  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
20*dfc6aa5cSAndroid Build Coastguard Worker  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*dfc6aa5cSAndroid Build Coastguard Worker  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*dfc6aa5cSAndroid Build Coastguard Worker  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*dfc6aa5cSAndroid Build Coastguard Worker  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*dfc6aa5cSAndroid Build Coastguard Worker  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*dfc6aa5cSAndroid Build Coastguard Worker  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*dfc6aa5cSAndroid Build Coastguard Worker  * POSSIBILITY OF SUCH DAMAGE.
27*dfc6aa5cSAndroid Build Coastguard Worker  */
28*dfc6aa5cSAndroid Build Coastguard Worker 
29*dfc6aa5cSAndroid Build Coastguard Worker #ifdef _WIN32
30*dfc6aa5cSAndroid Build Coastguard Worker #ifndef strcasecmp
31*dfc6aa5cSAndroid Build Coastguard Worker #define strcasecmp  stricmp
32*dfc6aa5cSAndroid Build Coastguard Worker #endif
33*dfc6aa5cSAndroid Build Coastguard Worker #ifndef strncasecmp
34*dfc6aa5cSAndroid Build Coastguard Worker #define strncasecmp  strnicmp
35*dfc6aa5cSAndroid Build Coastguard Worker #endif
36*dfc6aa5cSAndroid Build Coastguard Worker #endif
37*dfc6aa5cSAndroid Build Coastguard Worker 
38*dfc6aa5cSAndroid Build Coastguard Worker #ifdef _MSC_VER
39*dfc6aa5cSAndroid Build Coastguard Worker #define SNPRINTF(str, n, format, ...) \
40*dfc6aa5cSAndroid Build Coastguard Worker   _snprintf_s(str, n, _TRUNCATE, format, ##__VA_ARGS__)
41*dfc6aa5cSAndroid Build Coastguard Worker #else
42*dfc6aa5cSAndroid Build Coastguard Worker #define SNPRINTF  snprintf
43*dfc6aa5cSAndroid Build Coastguard Worker #endif
44*dfc6aa5cSAndroid Build Coastguard Worker 
45*dfc6aa5cSAndroid Build Coastguard Worker #ifndef min
46*dfc6aa5cSAndroid Build Coastguard Worker #define min(a, b)  ((a) < (b) ? (a) : (b))
47*dfc6aa5cSAndroid Build Coastguard Worker #endif
48*dfc6aa5cSAndroid Build Coastguard Worker 
49*dfc6aa5cSAndroid Build Coastguard Worker #ifndef max
50*dfc6aa5cSAndroid Build Coastguard Worker #define max(a, b)  ((a) > (b) ? (a) : (b))
51*dfc6aa5cSAndroid Build Coastguard Worker #endif
52*dfc6aa5cSAndroid Build Coastguard Worker 
53*dfc6aa5cSAndroid Build Coastguard Worker extern double getTime(void);
54