Skip to content

Commit

Permalink
Merge pull request #27 from keithc-ca/aix
Browse files Browse the repository at this point in the history
Enable AIX build with xlc 13.1
  • Loading branch information
andrew-m-leonard authored Aug 28, 2018
2 parents ec5b733 + 9929cd7 commit 9cd3bc2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/java.base/share/native/libjimage/NativeImageBuffer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved
* ===========================================================================
*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -41,6 +45,16 @@
#include "jimage.hpp"
#include "osSupport.hpp"

#if defined(__xlC__) && (__xlC__ >= 0x0d01)
/*
* Version 13.1.3 of xlc seems to have trouble parsing the `__attribute__`
* annotation in the generated header file we're about to include. Repeating
* the forward declaration (without the braces) here avoids the diagnostic:
* 1540-0040 (S) The text "void" is unexpected. "visibility" may be undeclared or ambiguous.
*/
extern "C" JNIEXPORT jobject JNICALL Java_jdk_internal_jimage_NativeImageBuffer_getNativeMap(JNIEnv *, jclass, jstring);
#endif

#include "jdk_internal_jimage_NativeImageBuffer.h"


Expand Down
7 changes: 7 additions & 0 deletions src/java.base/unix/native/include/jni_md.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved
* ===========================================================================
*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -37,6 +41,9 @@
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#endif
#elif defined(__xlC__) && (__xlC__ >= 0x0d01) /* xlc version 13.1 or better required */
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#else
#define JNIEXPORT
#define JNIIMPORT
Expand Down

0 comments on commit 9cd3bc2

Please sign in to comment.