jdk/src/java.desktop/share/native/libjsound/Utilities.h
author bobv
Mon, 19 Oct 2015 13:41:09 -0400
changeset 33653 c1ee09fe3274
parent 25859 3317bb8137f4
permissions -rw-r--r--
8136556: Add the ability to perform static builds of MacOSX x64 binaries Reviewed-by: ihse, bdelsart, gadams, lfoltan, rriggs, hseigel, twisti
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 25859
diff changeset
     2
 * Copyright (c) 1998, 2015, 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
#include <jni.h>
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 25859
diff changeset
    27
#include "jni_util.h"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include "SoundDefs.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "Configure.h"          // put flags for debug msgs etc. here
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
// return 1 if this platform is big endian, or 0 for little endian
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
int UTIL_IsBigEndianPlatform();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
// ERROR PRINTS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#ifdef USE_ERROR
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    37
#define ERROR0(string)                        { fprintf(stdout, (string)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    38
#define ERROR1(string, p1)                    { fprintf(stdout, (string), (p1)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    39
#define ERROR2(string, p1, p2)                { fprintf(stdout, (string), (p1), (p2)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    40
#define ERROR3(string, p1, p2, p3)            { fprintf(stdout, (string), (p1), (p2), (p3)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    41
#define ERROR4(string, p1, p2, p3, p4)        { fprintf(stdout, (string), (p1), (p2), (p3), (p4)); fflush(stdout); }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#define ERROR0(string)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#define ERROR1(string, p1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#define ERROR2(string, p1, p2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#define ERROR3(string, p1, p2, p3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#define ERROR4(string, p1, p2, p3, p4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
// TRACE PRINTS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#ifdef USE_TRACE
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    53
#define TRACE0(string)                        { fprintf(stdout, (string)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    54
#define TRACE1(string, p1)                    { fprintf(stdout, (string), (p1)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    55
#define TRACE2(string, p1, p2)                { fprintf(stdout, (string), (p1), (p2)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    56
#define TRACE3(string, p1, p2, p3)            { fprintf(stdout, (string), (p1), (p2), (p3)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    57
#define TRACE4(string, p1, p2, p3, p4)        { fprintf(stdout, (string), (p1), (p2), (p3), (p4)); fflush(stdout); }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    58
#define TRACE5(string, p1, p2, p3, p4, p5)    { fprintf(stdout, (string), (p1), (p2), (p3), (p4), (p5)); fflush(stdout); }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define TRACE0(string)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#define TRACE1(string, p1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#define TRACE2(string, p1, p2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#define TRACE3(string, p1, p2, p3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#define TRACE4(string, p1, p2, p3, p4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#define TRACE5(string, p1, p2, p3, p4, p5)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
// VERBOSE TRACE PRINTS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#ifdef USE_VERBOSE_TRACE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#define VTRACE0(string)                 fprintf(stdout, (string));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#define VTRACE1(string, p1)             fprintf(stdout, (string), (p1));
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 5506
diff changeset
    73
#define VTRACE2(string, p1, p2)         fprintf(stdout, (string), (p1), (p2));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#define VTRACE3(string, p1, p2, p3)     fprintf(stdout, (string), (p1), (p2), (p3));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define VTRACE4(string, p1, p2, p3, p4) fprintf(stdout, (string), (p1), (p2), (p3), (p4));
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#define VTRACE0(string)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#define VTRACE1(string, p1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#define VTRACE2(string, p1, p2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
#define VTRACE3(string, p1, p2, p3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#define VTRACE4(string, p1, p2, p3, p4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
void ThrowJavaMessageException(JNIEnv *e, const char *exClass, const char *msg);