Re: [PATCH 1/1] do not add common-main to lib
- From
Christian Hesse <list@eworm.de>
- Date
- Aug 15, 2016, 12:30 UTC
- Message-ID
- <20160815143007.2225c655@leda.localdomain>
- In-Reply-To
- <alpine.DEB.2.20.1608151418150.4924@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> on Mon, 2016/08/15 14:20:
Show 16 quoted lines
> Hi Christian, > > On Mon, 15 Aug 2016, Christian Hesse wrote: > > > From: Christian Hesse <mail@eworm.de> > > > > Commit 08aade70 (mingw: declare main()'s argv as const) changed > > declaration of main function. This breaks linking external projects > > (e.g. cgit) to libgit.a with: > > > > error: Multiple definition of `main' > > > > So do not add common-main to lib and let projects have their own > > main function. > > I am opposed to this change.
Me too. :-p
Show 7 quoted lines
> For one, libgit.a is *not* a library with an API, for a good reason: > nothing in Git's development guarantees any kind of stable API. For that > reason, libgit.a is not installed, either, and neither are any headers. > > And even more importantly: *iff* you *insist* on using libgit.a in your > project *despite* having been told not to, it is your responsibility to > stay up-to-date with the requirements of it.
cgit pulls in the git tree as a subproject. We are aware that the API changes all the time and that's fine. Usually we just fix it, this time I missed the background information of the change.
Show 6 quoted lines
> One such requirement is that you now implement cmd_main() instead of > main(). > > So if you want to continue to have an out-of-tree project that links > against the (private) libgit.a, it is your out-of-tree project that needs > changing, not libgit.a.
Already updated my code. ;) Thanks!
--
main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];)
putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}