Example #1
0
void WriteLog(PCHAR buf, WORD len)
{
  WORD F;
  if (LogPath != NULL)
   {
    F = FOpen((PCHARFAR)&LogPath);
    if (F == 0xffff)
    {
     F = FCreate((PCHARFAR)&LogPath);
    }
    FSize(F);
    FWrite(F, (PCHARFAR)buf, len);
    FClose(F);
   }
}
Example #2
0
File: main.cpp Project: CCJY/coliru
int main()
{
	auto b = std::make_shared<B>();
	auto fun = FCreate(&B::Increment, b);

	for (int i : {10, 32, 0})
	{
		if(!i)
			b.reset();

		if(fun(i))
			std::cout << "[success]\n";
		else
			std::cout << "[fail]\n";
	}
}
Example #3
0
File: main.cpp Project: CCJY/coliru
int main(){
    
    auto a = FCreate(&B::Increment, std::make_shared<B>(), std::placeholders::_1);
    
    return 0;
}
Example #4
0
extern  cg_init_info    BEInit( cg_switches cg_data, cg_target_switches tg_data,
                                uint opt_size, proc_revision proc ) {
//===================================================================

    cg_init_info        info;
    int                 i;

    Model = cg_data;
    if( EnvVar( "ACTION_STDOUT" ) ) {
        Actions = FStdOut();
    } else {
        Actions = FCreate( "ACTIONS" );
    }
    ++FilesOpen;
    Action( "BEInit switches==" );
    Action( "%h %h", cg_data, tg_data );
    Action( ", opt_size==%d, proc_rev=%h%n", opt_size, proc );
    SymDebug = 0;
    TypDebug = 0;
    if( cg_data & DBG_LOCALS ) {
        SymDebug = FCreate( "DBGSYM" );
        ++FilesOpen;
    }
    if( cg_data & DBG_TYPES ) {
        TypDebug = FCreate( "DBGTYP" );
        ++FilesOpen;
    }
    TypeIdx = 0;
    InitDbgInfo();
    TypeInit();
    TypeDef( TY_DEFAULT, 0 );
    Inlines = NULL;
    NodeList = NULL;
    AutoList = NULL;
    LblList = NULL;
    BackList = NULL;
    TempList = NULL;
    StaticList = NULL;
    LabelId = 0;
    NodeId = 0;
    BackId = 0;
    TempId = 0;
    SelId = 0;
    SegDefs = NULL;
    CGState = S_INIT;
    InProc = NULL;
    FilesOpen = 0;
    for( i = 0; i < MAX_SEG; ++i ) {
        Locs[i] = 0;
        Files[i].hdl = 0;
        Files[i].name = NULL;
        Files[i].exists = false;
        SegOk[i] = false;
    }
    CurSeg = 0;
    Out = Files[CurSeg].hdl;
    CodeSeg = -1;
    TargTypeInit();
    Action( "BEInit%n" );
    info.version.is_large = true;
    info.version.revision = II_REVISION;
#if _TARGET & _TARG_IAPX86
    info.version.target = II_TARG_8086;
#elif _TARGET & _TARG_80386
    info.version.target = II_TARG_80386;
#elif _TARGET & _TARG_AXP
    info.version.target = II_TARG_AXP;
#elif _TARGET & _TARG_PPC
    info.version.target = II_TARG_PPC;
#else
    #error UNKNOWN TARGET
#endif
    return( info );
}