[PATCH 2/7] Allow DDX to provide a main()

Jon TURNEY jon.turney at dronecode.org.uk
Mon Dec 3 09:53:55 PST 2012


On 30/11/2012 23:50, Julien Cristau wrote:
> On Thu, Nov  8, 2012 at 13:41:14 +0000, Jon TURNEY wrote:
> 
>> XQuartz already conditionally renames main() as dix_main() so it can provide
>> it's own main().  This isn't ideal as it prevents libdix built this way from
>> being useful with any other DDX.
>>
>> So instead, always name that function dix_main(), and provide a stub main()
>> which just calls it where needed.
>>
>> Add a main() to XWin.
>> It's no longer neccessary to link XWin and XQuartz with libmain.
>>
>> Future work: prototype dix_main() somewhere, without it ending up in sdksyms...
>>
> Doesn't that mean adding the declaration in a file not listed by
> sdksyms.sh?

Um.  I think so.

> There's no above copyright notice.  Problably doesn't matter because
> this file is so trivial it's not copyrightable, but might as well...

Fixed

>> --- a/hw/xwin/InitOutput.c
>> +++ b/hw/xwin/InitOutput.c
>> @@ -186,6 +186,12 @@ ddxBeforeReset(void)
>>  }
>>  #endif
>>  
>> +int
>> +main(int argc, char *argv[], char *envp[])
>> +{
>> +    return dix_main(argc, argv, envp);
>> +}
>> +
> 
> I guess a later patch changes this to be different from the stub?

Yes, I have a number of patches which add things here.



More information about the xorg-devel mailing list