Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace kdbproposal.h #2840

Open
kodebach opened this issue Jul 31, 2019 · 1 comment

Comments

@kodebach
Copy link
Contributor

commented Jul 31, 2019

As noted in #2809 kdbproposal.h is not a good solution. It would be better to have a macro that enables experimental stuff. For example:

In our header (kdbfoo.h) we would have:

int elektraFoo (int x);

#ifdef ELEKTRA_EXPERIMENTAL

int elektraNewFoo(int x, int y);

#endif

To use the experimental symbols a user would write:

#define ELEKTRA_EXPERIMENTAL
#include <kdbfoo.h>

We could also use an integer similar to _POSIX_C_SOURCE to enable multiple different experimental versions. Then a user can opt in to only one experimental API and not automatically enable all future experimental APIs.

@kodebach kodebach referenced this issue Jul 31, 2019
1 of 14 tasks complete

@markus2330 markus2330 added this to the 0.9.0 milestone Aug 1, 2019

@markus2330 markus2330 added the cleanup label Aug 1, 2019

@markus2330

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

Thank you for writing down the proposal!

I definitely agree that we need to get rid of libproposal. This is a must-have for 1.0.

How far we should go with include magic is a difficult question. If you combine your idea from here and from #2809 we could also build something like:

#define ELEKTRA_USE_VERSION 105
#include <elektra/kdb.h>

and then you get the symbols of elektra 1.5.*, either by #if or also #define for renames (e.g. signature changes), with an implementation in kdb.h like:

#if ELEKTRA_USE_VERSION >= 105
int symbol_defined_in_105()
#endif
#if ELEKTRA_USE_VERSION >= 103
#define old_name symbol_renamed_in_103
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.