scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

delobj.c (280B)


      1 #include <stdio.h>
      2 #include <stdlib.h>
      3 
      4 #include <scc/mach.h>
      5 
      6 #include "libmach.h"
      7 
      8 #include "elf/fun.h"
      9 #include "coff32/fun.h"
     10 
     11 static void (*ops[NFORMATS])(Obj *) = {
     12 	[COFF32] = coff32del,
     13 	[ELF] = elfdel,
     14 };
     15 
     16 void
     17 delobj(Obj *obj)
     18 {
     19 	(*ops[objfmt(obj)])(obj);
     20 	free(obj);
     21 }