Exemple #1
0
static void defineFeatureMacros( void )
{
    char        *end_watcom;
    char        *end_feature;
    const char  **p;
    auto char   buff[128];
    static const char *feature[] = {
        "BOOL",
        "MUTABLE",
        "RTTI",
        "EXPLICIT",
        "NAMESPACE",
        "NEW_CASTS",
        "INT64",
        "TYPENAME",
        NULL
    };

    end_watcom = stxpcpy( buff, "__WATCOM_" );
    for( p = feature; *p != NULL; ++p ) {
        end_feature = stxpcpy( end_watcom, *p );
        strcpy( end_feature, "__" );
        PreDefineStringMacro( buff );
    }
    defineStringMacro( "_PUSHPOP_SUPPORTED" );
}
Exemple #2
0
void *CtxWhereAreYou(           // SET DEBUGGING BUFFER
    void )
{
    char *buf;                  // - points into buffer

    buf = stxpcpy( CompilerContext, ctx_names[ context ] );
    switch( context ) {
      case CTX_CMDLN_ENV :
      case CTX_CMDLN_PGM :
        buf = stxpcpy( buf, ": " );
        buf = stxpcpy( buf, CtxGetSwitchAddr() );
        break;
      case CTX_FORCED_INCS :
      case CTX_SOURCE :
        if( location.src_file == NULL ) break;
        buf = stxpcpy( buf, ": " );
        buf = stxpcpy( buf, SrcFileName( location.src_file ) );
        buf = stxpcpy( buf, "(" );
        buf = stxdcpy( buf, location.line );
        buf = stxpcpy( buf, "," );
        buf = stxdcpy( buf, location.column );
        buf = stxpcpy( buf, ")" );
        break;
      case CTX_CG_FUNC :
      case CTX_FUNC_GEN :
        buf = stxpcpy( buf, ": " );
        if( func == NULL ) {
            buf = stxpcpy( buf, "data generation" );
        } else {
            VBUF vbuf;
            buf = stxpcpy( buf, DbgSymNameFull( func, &vbuf ) );
            VbufFree( &vbuf );
        }
        if( ( context == CTX_FUNC_GEN )
          &&( line != 0 ) ) {
            buf = stxpcpy( buf, "(" );
            buf = stxdcpy( buf, location.line );
            buf = stxpcpy( buf, ")" );
        }
        break;
    }
    return CompilerContext;
}