tcc: Refactor "compute default outfile name" into libtcc function
commitbdae4a59c3a74b2ff464c02029c625251719a7d7
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Wed, 16 Jun 2010 12:54:24 +0000 (16 16:54 +0400)
committerKirill Smelkov <kirr@mns.spb.ru>
Sun, 20 Jun 2010 17:36:47 +0000 (20 21:36 +0400)
treeff92d915614eeecb0516f1c9015007d8c44b53c7
parenta919a373da07305e763d1cb4ecb3a5a44bdebb2a
tcc: Refactor "compute default outfile name" into libtcc function

Since for upcoming -MD support default _compile_ output file be needed
even when preprocesssing (tcc -E), let's move this code out of one
particular condition block into a common function, so that we could use
it in deps generation code too.

v2:

- As suggested by grischka, moved into libtcc function instead of always
  computing near start of main()
- There is a FIXME about how to return result - I don't want to bother
  callers with allocating temp buffers, not I think it will be a good
  idea to hook default_target to TCCState. Clearly, I'm to used to
  things like std::string and python's str...
libtcc.c
tcc.c