src/main/native/carlie/jdk/jni_util_md-windows.c
/*
 * Windows symbols can be simple like JNI_OnLoad or __stdcall format
 * like _JNI_OnLoad@8. We need to handle both.
 */
Windows symbols can be simple like JNI_OnLoad or __stdcall format
like _JNI_OnLoad@8. We need to handle both.
Windows symbols can be simple like JNI_OnLoad or __stdcall format like _JNI_OnLoad@8 . We need to handle both .
void buildJniFunctionName(const char *sym, const char *cname,
                          char *jniEntryName) {
    if (cname != NULL) {
        char *p = strrchr(sym, '@');
        if (p != NULL && p != sym) {
            strncpy(jniEntryName, sym, (p - sym));
            jniEntryName[(p-sym)] = '\0';
            strcat(jniEntryName, "_");
            strcat(jniEntryName, cname);
            strcat(jniEntryName, p);
        } else {
            strcpy(jniEntryName, sym);
            strcat(jniEntryName, "_");
            strcat(jniEntryName, cname);
        }
    } else {
        strcpy(jniEntryName, sym);
    }
    return;
}
void buildJniFunctionName ( const char * sym , const char * cname , char * jniEntryName ) { if ( cname != NULL ) { char * p = strrchr ( sym , ' ' ) ; if ( p != NULL && p != sym ) { strncpy ( jniEntryName , sym , ( p - sym ) ) ; jniEntryName [ ( p - sym ) ] = ' \0 ' ; strcat ( jniEntryName , " " ) ; strcat ( jniEntryName , cname ) ; strcat ( jniEntryName , p ) ; } else { strcpy ( jniEntryName , sym ) ; strcat ( jniEntryName , " " ) ; strcat ( jniEntryName , cname ) ; } } else { strcpy ( jniEntryName , sym ) ; } return ; }
Windows symbols can be simple like JNI_OnLoad or __stdcall format
 like _JNI_OnLoad@8.
Windows symbols can be simple like JNI_OnLoad or __stdcall format like _JNI_OnLoad@8 .
// sym == _JNI_OnLoad@8 // jniEntryName == _JNI_OnLoad //jniEntryName == _JNI_OnLoad_cname@8