jdk/src/share/native/sun/awt/medialib/mlib_types.h
author bae
Fri, 25 Mar 2011 12:50:59 +0300
changeset 8939 04615dca2a76
parent 5506 202f599c92aa
child 11009 5fb36e999b2b
permissions -rw-r--r--
6989717: media native code compiler warnings Reviewed-by: jgodinez, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#ifndef MLIB_TYPES_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#define MLIB_TYPES_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include <limits.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#if defined(_MSC_VER)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#include <float.h>                      /* for FLT_MAX and DBL_MAX */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#ifndef DBL_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#define DBL_MAX 1.7976931348623157E+308 /* max decimal value of a "double" */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#ifndef FLT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#define FLT_MAX 3.402823466E+38F        /* max decimal value of a "float" */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#ifndef FLT_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#define FLT_MIN 1.175494351e-38F        /* min normalised value of a "float" */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#ifdef  __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
extern "C" {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
typedef char               mlib_s8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
typedef unsigned char      mlib_u8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
typedef short              mlib_s16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
typedef unsigned short     mlib_u16;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
typedef int                mlib_s32;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
typedef unsigned int       mlib_u32;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
typedef float              mlib_f32;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
typedef double             mlib_d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#if defined(__linux__)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#include <stdint.h>                     /* for uintptr_t */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#include <malloc.h>                     /* for ptrdiff_t */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#include <link.h>                       /* for uintptr_t */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#include <stddef.h>                     /* for ptrdiff_t */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
#endif  /* __linux__ */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#ifdef MLIB_OS64BIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
typedef long               mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
typedef unsigned long      mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define MLIB_S64_MIN       LONG_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#define MLIB_S64_MAX       LONG_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#define MLIB_S64_CONST(x)  x##L
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#define MLIB_U64_CONST(x)  x##UL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#elif (__STDC__ - 0 == 0) || defined(__GNUC__)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#if defined(_NO_LONGLONG)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
typedef union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
  mlib_d64 d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  mlib_s32 s32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
} mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
typedef union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
  mlib_d64 d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
  mlib_u32 u32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
} mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
typedef long long          mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
typedef unsigned long long mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
#define MLIB_S64_MIN       LLONG_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
#define MLIB_S64_MAX       LLONG_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
#define MLIB_S64_CONST(x)  x##LL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#define MLIB_U64_CONST(x)  x##ULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#endif /* !defined(_NO_LONGLONG) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
#endif  /* MLIB_OS64BIT */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#elif defined(_MSC_VER)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#if defined(_NO_LONGLONG)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
typedef union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
  mlib_d64 d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
  mlib_s32 s32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
} mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
typedef union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
  mlib_d64 d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
  mlib_u32 u32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
} mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
typedef __int64            mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
typedef unsigned __int64   mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#define MLIB_S64_MIN       _I64_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#define MLIB_S64_MAX       _I64_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#define MLIB_S64_CONST(x)  x##I64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#define MLIB_U64_CONST(x)  x##UI64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#endif /* !defined(_NO_LONGLONG) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#include <stddef.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#if !defined(_WIN64)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
typedef int                intptr_t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
typedef unsigned int       uintptr_t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#endif  /* _WIN64 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
#error  "unknown platform"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
typedef uintptr_t          mlib_addr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
typedef void*              mlib_ras;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
#define MLIB_S8_MIN        SCHAR_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#define MLIB_S8_MAX        SCHAR_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#define MLIB_U8_MIN        0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#define MLIB_U8_MAX        UCHAR_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
#define MLIB_S16_MIN       SHRT_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#define MLIB_S16_MAX       SHRT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
#define MLIB_U16_MIN       0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#define MLIB_U16_MAX       USHRT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
#define MLIB_S32_MIN       INT_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#define MLIB_S32_MAX       INT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#define MLIB_U32_MIN       0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
#define MLIB_U32_MAX       UINT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
#define MLIB_F32_MIN      -FLT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
#define MLIB_F32_MAX       FLT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#define MLIB_D64_MIN      -DBL_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
#define MLIB_D64_MAX       DBL_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#ifdef  __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
#endif  /* MLIB_TYPES_H */