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

Problem: zsock header not amenable to generation using CLASS api #935

Closed
twhittock opened this issue Feb 22, 2015 · 1 comment
Closed

Problem: zsock header not amenable to generation using CLASS api #935

twhittock opened this issue Feb 22, 2015 · 1 comment

Comments

@twhittock
Copy link
Contributor

I'd like to change the definition from this pattern:

#ifdef ZSOCK_NOCHECK
#define zsock_new(t) zsock_new_(t, NULL, 0)
#else
#define zsock_new(t) zsock_new_(t, __FILE__, __LINE__)
#endif
zsock_t *zsock_new_(int type, const char *fn, int ln);

to something more like this:

zsock_t *zsock_new(int type);

#if !defined(ZSOCK_NOCHECK) // double negative - would like to use ZSOCK_CHECK instead.
inline void zsock_new__checked(int type, const char *fn, int ln)
{
    zsock_t *ret = zsock_new(type);
    zsock_register(ret, fn, ln);
    return ret;
}
#define zsock_new(t) zsock_new__checked(t, __FILE__, __LINE)
#endif
@hintjens
Copy link
Member

Sure, sounds good.
On Feb 22, 2015 2:42 PM, "twhittock" notifications@github.com wrote:

I'd like to change the definition from this pattern:

#ifdef ZSOCK_NOCHECK
#define zsock_new(t) zsock_new_(t, NULL, 0)
#else
#define zsock_new(t) zsock_new_(t, FILE, LINE)
#endifzsock_t *zsock_new_(int type, const char *fn, int ln);

to something more like this:

zsock_t *zsock_new(int type);

#if !defined(ZSOCK_NOCHECK) // double negative - would like to use ZSOCK_CHECK instead.inline void zsock_new__checked(int type, const char *fn, int ln)
{
zsock_t *ret = zsock_new(type);
zsock_register(ret, fn, ln);
return ret;
}
#endif


Reply to this email directly or view it on GitHub
#935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants