[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GNUnet-developers] Consider phasing out GNUNET_SERVICE_MAIN
From: |
Alessio Vanni |
Subject: |
Re: [GNUnet-developers] Consider phasing out GNUNET_SERVICE_MAIN |
Date: |
Sat, 07 Sep 2019 16:20:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Christian Grothoff <address@hidden> writes:
> but in this case there seems to be a better alternative: use
> a C constructor to call GNUNET_OS_init():
>
> /**
> * Initialize i18n
> */
> void __attribute__ ((constructor)) i18n_init () {
> GNUNET_OS_init (...);
> }
>
> Constructors run before main(), so that should fix your problem nicely.
I wasn't aware of this feature. Would it be OK to add a constructor
calling `GNUNET_OS_init' in the gnunet-ext service? It seems to be
something that a reference implementation/template might want to show.
Thanks,
A.V.