Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5090153

JNIEXPORT should be defined as empty on Solaris/Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • hotspot
    • None
    • mustang
    • generic
    • linux

        Currently, JNIEXPORT is defined as 'extern "C"' on Solaris and Linux in HotSpot,
        on Windows it is defined as '__declspec(dllexport)'. On Solaris and Linux, it
        will force C linkage, but on Windows it does not. As the result, some JVM
        functions have C linkage on Solaris/Linux, but C++ linkage on Windows
        (e.g. JVM_RegisterUnsafeMethods), that doesn't sound right.

        We should redefine JNIEXPORT and follow the definition in JDK, that is,
        empty on Solaris/Linux, '__decl(dllexport)' on Windows. JNIEXPORT only makes
        a symbol public, it has nothing to do with a symbol's linkage type. All public
        JVM functions should have C linkage, and they should be wrapped explicitly
        inside 'extern "C" { ... }"

        ###@###.### 2004-08-20

              hhuangsunw Hui Huang (Inactive)
              hhuangsunw Hui Huang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: