j2k.c: remove hardcoded constants related to m_state, and useless FIXME
[openjpeg.git] / src / lib / openmj2 / opj_includes.h
1 /*
2  * The copyright in this software is being made available under the 2-clauses
3  * BSD License, included below. This software may be subject to other third
4  * party and contributor rights, including patent rights, and no such rights
5  * are granted under this license.
6  *
7  * Copyright (c) 2005, Herve Drolon, FreeImage Team
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 #ifndef OPJ_INCLUDES_H
32 #define OPJ_INCLUDES_H
33
34 /*
35  ==========================================================
36    Standard includes used by the library
37  ==========================================================
38 */
39 #include <memory.h>
40 #include <stdlib.h>
41 #include <string.h>
42 #include <math.h>
43 #include <float.h>
44 #include <time.h>
45 #include <stdio.h>
46 #include <stdarg.h>
47 #include <ctype.h>
48
49 /*
50  ==========================================================
51    OpenJPEG interface
52  ==========================================================
53  */
54 #include "openjpeg.h"
55
56 /*
57  ==========================================================
58    OpenJPEG modules
59  ==========================================================
60 */
61
62 /* Ignore GCC attributes if this is not GCC */
63 #ifndef __GNUC__
64 #define __attribute__(x) /* __attribute__(x) */
65 #endif
66
67 /*
68 The inline keyword is supported by C99 but not by C90.
69 Most compilers implement their own version of this keyword ...
70 */
71 #ifndef INLINE
72 #if defined(_MSC_VER)
73 #define INLINE __forceinline
74 #elif defined(__GNUC__)
75 #define INLINE __inline__
76 #elif defined(__MWERKS__)
77 #define INLINE inline
78 #else
79 /* add other compilers here ... */
80 #define INLINE
81 #endif /* defined(<Compiler>) */
82 #endif /* INLINE */
83
84 /* Are restricted pointers available? (C99) */
85 #if (__STDC_VERSION__ != 199901L)
86 /* Not a C99 compiler */
87 #ifdef __GNUC__
88 #define restrict __restrict__
89 #else
90 #define restrict /* restrict */
91 #endif
92 #endif
93
94 /* MSVC and Borland C do not have lrintf */
95 #if defined(_MSC_VER) || defined(__BORLANDC__)
96 static INLINE long lrintf(float f)
97 {
98 #ifdef _M_X64
99     return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
100 #else
101     int i;
102
103     _asm{
104         fld f
105         fistp i
106     };
107
108     return i;
109 #endif
110 }
111 #endif
112
113 #include "j2k_lib.h"
114 #include "opj_malloc.h"
115 #include "event.h"
116 #include "bio.h"
117 #include "cio.h"
118
119 #include "image.h"
120 #include "j2k.h"
121 #include "jp2.h"
122 #include "jpt.h"
123
124 #include "mqc.h"
125 #include "raw.h"
126 #include "bio.h"
127 #include "tgt.h"
128 #include "pi.h"
129 #include "tcd.h"
130 #include "t1.h"
131 #include "dwt.h"
132 #include "t2.h"
133 #include "mct.h"
134 #include "int.h"
135 #include "fix.h"
136
137 /* JPWL>> */
138 #ifdef USE_JPWL
139 #include "jpwl.h"
140 #endif /* USE_JPWL */
141 /* <<JPWL */
142
143 #endif /* OPJ_INCLUDES_H */