jdk/src/share/native/sun/awt/medialib/mlib_types.h
author simonis
Tue, 26 Nov 2013 16:40:31 +0100
changeset 22597 7515a991bb37
parent 12047 320a714614e9
permissions -rw-r--r--
8024854: PPC64: Basic changes and files to build the class library on AIX Reviewed-by: alanb, prr, sla, chegar, michaelm, mullan, art Contributed-by: luchsh@linux.vnet.ibm.com, spoole@linux.vnet.ibm.com, thomas.stuefe@sap.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
22597
7515a991bb37 8024854: PPC64: Basic changes and files to build the class library on AIX
simonis
parents: 12047
diff changeset
     2
 * Copyright (c) 1997, 2013, 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
22597
7515a991bb37 8024854: PPC64: Basic changes and files to build the class library on AIX
simonis
parents: 12047
diff changeset
    60
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__) || defined(_AIX)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
11009
5fb36e999b2b 7113017: Use POSIX compliant include file headers in sun/awt/medialib/mlib_types.h
prr
parents: 5506
diff changeset
    62
#include <stdint.h>
5fb36e999b2b 7113017: Use POSIX compliant include file headers in sun/awt/medialib/mlib_types.h
prr
parents: 5506
diff changeset
    63
#include <stddef.h>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 11009
diff changeset
    65
#if defined(MLIB_OS64BIT) || (defined(MACOSX) && defined(_LP64))
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
typedef long               mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
typedef unsigned long      mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#define MLIB_S64_MIN       LONG_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#define MLIB_S64_MAX       LONG_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#define MLIB_S64_CONST(x)  x##L
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#define MLIB_U64_CONST(x)  x##UL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#elif (__STDC__ - 0 == 0) || defined(__GNUC__)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#if defined(_NO_LONGLONG)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
typedef union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
  mlib_d64 d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
  mlib_s32 s32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
} mlib_s64;
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_u32 u32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
} mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
typedef long long          mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
typedef unsigned long long mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
#define MLIB_S64_MIN       LLONG_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
#define MLIB_S64_MAX       LLONG_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
#define MLIB_S64_CONST(x)  x##LL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
#define MLIB_U64_CONST(x)  x##ULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
#endif /* !defined(_NO_LONGLONG) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
#endif  /* MLIB_OS64BIT */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#elif defined(_MSC_VER)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
#if defined(_NO_LONGLONG)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
typedef union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
  mlib_d64 d64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
  mlib_s32 s32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
} mlib_s64;
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_u32 u32[2];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
} mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
typedef __int64            mlib_s64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
typedef unsigned __int64   mlib_u64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#define MLIB_S64_MIN       _I64_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#define MLIB_S64_MAX       _I64_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#define MLIB_S64_CONST(x)  x##I64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#define MLIB_U64_CONST(x)  x##UI64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#endif /* !defined(_NO_LONGLONG) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#include <stddef.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#if !defined(_WIN64)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
typedef int                intptr_t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
typedef unsigned int       uintptr_t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#endif  /* _WIN64 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#error  "unknown platform"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
typedef uintptr_t          mlib_addr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
typedef void*              mlib_ras;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#define MLIB_S8_MIN        SCHAR_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
#define MLIB_S8_MAX        SCHAR_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
#define MLIB_U8_MIN        0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#define MLIB_U8_MAX        UCHAR_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
#define MLIB_S16_MIN       SHRT_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
#define MLIB_S16_MAX       SHRT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#define MLIB_U16_MIN       0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#define MLIB_U16_MAX       USHRT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#define MLIB_S32_MIN       INT_MIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
#define MLIB_S32_MAX       INT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#define MLIB_U32_MIN       0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
#define MLIB_U32_MAX       UINT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#define MLIB_F32_MIN      -FLT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
#define MLIB_F32_MAX       FLT_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#define MLIB_D64_MIN      -DBL_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#define MLIB_D64_MAX       DBL_MAX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
#ifdef  __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
#endif  /* MLIB_TYPES_H */