Пример #1
0
#include "hercules.h"
#include "machdep.h"

/*--------------------------------------------------*/
/*   "Unusual" (i.e. noteworthy) build options...   */
/*--------------------------------------------------*/

static const char *build_info[] = {

#if defined(_MSVC_)
    "Windows (MSVC) "
  #if defined(DEBUG)
    "** DEBUG ** "
  #endif
    "build for " MSTRING(HOST_ARCH)
  #if defined(CUSTOM_BUILD_STRING)
    ": \"" CUSTOM_BUILD_STRING "\""
  #endif
    ,
#elif defined(CUSTOM_BUILD_STRING)
    CUSTOM_BUILD_STRING,
#endif

#if !defined(_ARCHMODE2)
    "Mode:"
#else
    "Modes:"
#endif
#if defined(_370)
    " " _ARCH_370_NAME
Пример #2
0
    const char* bstr = (*e)->GetStringUTFChars(e, jstr, NULL);
    strncpy(self->namebuf, bstr, 128);
    (*e)->ReleaseStringUTFChars(e, jstr, bstr);

    *(char**) &self->name = self->namebuf;
    self->env = e;
    self->jplugin = (*e)->NewGlobalRef(e, plugin);
    self->ex.type = 0;
    
    (*e)->SetLongField(e, this, id_internal, (jlong) (intptr_t) self);
    ASSERTEX(e);
    
    void* handle = (void*) (intptr_t) (*e)->GetLongField(e, this, id_handle);
    ASSERTEX(e);
    char* err;
    int compat_version = *(int*) dlsym(handle, MSTRING(NB_VERSION_SYM));
    if ((err = dlerror()))
        goto dlsym_fail;
    if ((compat_version != NB_COMPAT_VERSION))
        goto version_mismatch;
    self->enable = dlsym(handle, MSTRING(NB_ENABLE_SYM));
    if ((err = dlerror()))
        goto dlsym_fail;
    self->disable = dlsym(handle, MSTRING(NB_DISABLE_SYM));
    if ((err = dlerror()))
        goto dlsym_fail;
    self->load = dlsym(handle, MSTRING(NB_LOAD_SYM));
    if ((err = dlerror()))
        goto dlsym_fail;
    
    sw_barrier(); /* aliasing */