Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/com/sun/media/sound/Utilities.h
38918 views
/*1* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include <jni.h>26#include "SoundDefs.h"27#include "Configure.h" // put flags for debug msgs etc. here2829// return 1 if this platform is big endian, or 0 for little endian30int UTIL_IsBigEndianPlatform();313233// ERROR PRINTS34#ifdef USE_ERROR35#define ERROR0(string) { fprintf(stdout, (string)); fflush(stdout); }36#define ERROR1(string, p1) { fprintf(stdout, (string), (p1)); fflush(stdout); }37#define ERROR2(string, p1, p2) { fprintf(stdout, (string), (p1), (p2)); fflush(stdout); }38#define ERROR3(string, p1, p2, p3) { fprintf(stdout, (string), (p1), (p2), (p3)); fflush(stdout); }39#define ERROR4(string, p1, p2, p3, p4) { fprintf(stdout, (string), (p1), (p2), (p3), (p4)); fflush(stdout); }40#else41#define ERROR0(string)42#define ERROR1(string, p1)43#define ERROR2(string, p1, p2)44#define ERROR3(string, p1, p2, p3)45#define ERROR4(string, p1, p2, p3, p4)46#endif474849// TRACE PRINTS50#ifdef USE_TRACE51#define TRACE0(string) { fprintf(stdout, (string)); fflush(stdout); }52#define TRACE1(string, p1) { fprintf(stdout, (string), (p1)); fflush(stdout); }53#define TRACE2(string, p1, p2) { fprintf(stdout, (string), (p1), (p2)); fflush(stdout); }54#define TRACE3(string, p1, p2, p3) { fprintf(stdout, (string), (p1), (p2), (p3)); fflush(stdout); }55#define TRACE4(string, p1, p2, p3, p4) { fprintf(stdout, (string), (p1), (p2), (p3), (p4)); fflush(stdout); }56#define TRACE5(string, p1, p2, p3, p4, p5) { fprintf(stdout, (string), (p1), (p2), (p3), (p4), (p5)); fflush(stdout); }57#else58#define TRACE0(string)59#define TRACE1(string, p1)60#define TRACE2(string, p1, p2)61#define TRACE3(string, p1, p2, p3)62#define TRACE4(string, p1, p2, p3, p4)63#define TRACE5(string, p1, p2, p3, p4, p5)64#endif656667// VERBOSE TRACE PRINTS68#ifdef USE_VERBOSE_TRACE69#define VTRACE0(string) fprintf(stdout, (string));70#define VTRACE1(string, p1) fprintf(stdout, (string), (p1));71#define VTRACE2(string, p1, p2) fprintf(stdout, (string), (p1), (p2));72#define VTRACE3(string, p1, p2, p3) fprintf(stdout, (string), (p1), (p2), (p3));73#define VTRACE4(string, p1, p2, p3, p4) fprintf(stdout, (string), (p1), (p2), (p3), (p4));74#else75#define VTRACE0(string)76#define VTRACE1(string, p1)77#define VTRACE2(string, p1, p2)78#define VTRACE3(string, p1, p2, p3)79#define VTRACE4(string, p1, p2, p3, p4)80#endif818283void ThrowJavaMessageException(JNIEnv *e, const char *exClass, const char *msg);848586