# HG changeset patch # User simonis # Date 1542730186 -3600 # Tue Nov 20 17:09:46 2018 +0100 # Node ID 167a22e810400421374fda8d87293505dd01f44d # Parent f7309a1491d9e3edaf2e90c1da40cc65cf353a85 8214120: [REDO] Fix sun.awt.nativedebug on X11 platforms diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -280,7 +280,7 @@ common/font \ # - LIBAWT_XAWT_EXCLUDES := medialib + LIBAWT_XAWT_EXCLUDES := medialib debug LIBAWT_XAWT_EXTRA_HEADER_DIRS := \ $(LIBAWT_DEFAULT_HEADER_DIRS) \ diff --git a/src/java.desktop/share/native/common/awt/debug/debug_assert.c b/src/java.desktop/share/native/common/awt/debug/debug_assert.c --- a/src/java.desktop/share/native/common/awt/debug/debug_assert.c +++ b/src/java.desktop/share/native/common/awt/debug/debug_assert.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,9 @@ static DASSERT_CALLBACK PfnAssertCallback = NULL; -void DAssert_Impl(const char *msg, const char * filename, int linenumber) { +/* JNIEXPORT because this function is also called from libawt_xawt */ +JNIEXPORT void JNICALL +DAssert_Impl(const char *msg, const char * filename, int linenumber) { if (PfnAssertCallback != NULL) { (*PfnAssertCallback)(msg, filename, linenumber); } else { diff --git a/src/java.desktop/share/native/common/awt/debug/debug_assert.h b/src/java.desktop/share/native/common/awt/debug/debug_assert.h --- a/src/java.desktop/share/native/common/awt/debug/debug_assert.h +++ b/src/java.desktop/share/native/common/awt/debug/debug_assert.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,8 @@ /* prototype for assert function */ typedef void (*DASSERT_CALLBACK)(const char * msg, const char * file, int line); -extern void DAssert_Impl(const char * msg, const char * file, int line); +/* JNIEXPORT because this function is also called from libawt_xawt */ +JNIEXPORT void JNICALL DAssert_Impl(const char * msg, const char * file, int line); extern void DAssert_SetCallback( DASSERT_CALLBACK pfn ); #else /* DEBUG not defined */ diff --git a/src/java.desktop/share/native/common/awt/debug/debug_trace.c b/src/java.desktop/share/native/common/awt/debug/debug_trace.c --- a/src/java.desktop/share/native/common/awt/debug/debug_trace.c +++ b/src/java.desktop/share/native/common/awt/debug/debug_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -237,16 +237,20 @@ /* * Called via DTRACE_PRINT macro. Outputs printf style formatted text. + * JNIEXPORT because these functions are also called from libawt_xawt. */ -void DTrace_VPrint( const char * file, int line, int argc, const char * fmt, va_list arglist ) { +JNIEXPORT void JNICALL +DTrace_VPrint( const char * file, int line, int argc, const char * fmt, va_list arglist ) { DASSERT(fmt != NULL); DTrace_VPrintImpl(fmt, arglist); } /* * Called via DTRACE_PRINTLN macro. Outputs printf style formatted text with an automatic newline. + * JNIEXPORT because these functions are also called from libawt_xawt. */ -void DTrace_VPrintln( const char * file, int line, int argc, const char * fmt, va_list arglist ) { +JNIEXPORT void JNICALL +DTrace_VPrintln( const char * file, int line, int argc, const char * fmt, va_list arglist ) { DTrace_VPrintImpl(fmt, arglist); DTrace_PrintImpl("\n"); } @@ -254,10 +258,12 @@ /* * Called via DTRACE_ macros. If tracing is enabled at the given location, it enters * the trace mutex and invokes the callback function to output the trace. + * JNIEXPORT because these functions are also called from libawt_xawt. */ -void DTrace_PrintFunction( DTRACE_PRINT_CALLBACK pfn, dtrace_id * pFileTraceId, dtrace_id * pLineTraceId, - const char * file, int line, - int argc, const char * fmt, ... ) { +JNIEXPORT void JNICALL +DTrace_PrintFunction( DTRACE_PRINT_CALLBACK pfn, dtrace_id * pFileTraceId, dtrace_id * pLineTraceId, + const char * file, int line, + int argc, const char * fmt, ... ) { va_list arglist; DASSERT(file != NULL); diff --git a/src/java.desktop/share/native/common/awt/debug/debug_trace.h b/src/java.desktop/share/native/common/awt/debug/debug_trace.h --- a/src/java.desktop/share/native/common/awt/debug/debug_trace.h +++ b/src/java.desktop/share/native/common/awt/debug/debug_trace.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,11 +59,12 @@ void DTrace_DisableMutex(); extern void DTrace_VPrintImpl(const char * fmt, va_list arglist); extern void DTrace_PrintImpl(const char * fmt, ...); -extern void DTrace_PrintFunction(DTRACE_PRINT_CALLBACK pfn, dtrace_id * pFileTraceId, dtrace_id * pTraceId, const char * file, int line, int argc, const char * fmt, ...); +/* JNIEXPORT because these functions are also called from libawt_xawt */ +JNIEXPORT void JNICALL DTrace_PrintFunction(DTRACE_PRINT_CALLBACK pfn, dtrace_id * pFileTraceId, dtrace_id * pTraceId, const char * file, int line, int argc, const char * fmt, ...); /* these functions are exported only for use in macros-- do not call them directly!!! */ -extern void DTrace_VPrint(const char * file, int line, int argc, const char * fmt, va_list arglist); -extern void DTrace_VPrintln(const char * file, int line, int argc, const char * fmt, va_list arglist); +JNIEXPORT void JNICALL DTrace_VPrint(const char * file, int line, int argc, const char * fmt, va_list arglist); +JNIEXPORT void JNICALL DTrace_VPrintln(const char * file, int line, int argc, const char * fmt, va_list arglist); /* each file includes this flag indicating module trace status */ static dtrace_id _Dt_FileTraceId = UNDEFINED_TRACE_ID;