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

Latest 1.1 update broke C-bindings #29

Closed
savely-krasovsky opened this issue Feb 2, 2018 · 9 comments
Closed

Latest 1.1 update broke C-bindings #29

savely-krasovsky opened this issue Feb 2, 2018 · 9 comments

Comments

@savely-krasovsky
Copy link

savely-krasovsky commented Feb 2, 2018

My bindings worked fine, but after latest update in td_log.h file appered C++ code (using keyword).

C:/src/td/td/telegram/td_log.h:61:1: error: unknown type name 'using'
 using td_log_fatal_error_callback_ptr = void (*)(const char *error_message);
 ^~~~~
C:/src/td/td/telegram/td_log.h:61:41: error: expected expression before 'void'
 using td_log_fatal_error_callback_ptr = void (*)(const char *error_message);
                                         ^~~~
C:/src/td/td/telegram/td_log.h:72:52: error: expected declaration specifiers or '...' before 'td_log_fatal_error_callback_ptr'
 TDJSON_EXPORT void td_set_log_fatal_error_callback(td_log_fatal_error_callback_ptr callback);
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~```
@savely-krasovsky
Copy link
Author

Maybe this can fix it:

typedef void (*td_log_fatal_error_callback_ptr)(const char *error_message);

But I can't check, because turns out that cgo can't link MSVC .dll 😞

@levlam
Copy link
Contributor

levlam commented Feb 2, 2018

Yes, it will be a correct syntax for C typedef.

@savely-krasovsky
Copy link
Author

savely-krasovsky commented Feb 3, 2018

@levlam so can it be fixed in the master?

@levlam
Copy link
Contributor

levlam commented Feb 3, 2018

I've already committed fix to the private repository. I will likely push it to github tomorrow along with some other fixes.

@savely-krasovsky
Copy link
Author

savely-krasovsky commented Feb 3, 2018

Oh, thanks, I will close after push.

@Nhoya
Copy link

Nhoya commented Feb 3, 2018

Any news? @levlam

@levlam
Copy link
Contributor

levlam commented Feb 3, 2018

Fixed in 7927df3. Thanks!

@Nhoya
Copy link

Nhoya commented Feb 3, 2018

Can you please ship a new release since 1.1 has bindings broken?

@savely-krasovsky
Copy link
Author

savely-krasovsky commented Feb 3, 2018

@Nhoya they should work after this fix, just rebuild and reinstall tdlib. I will add new methods a bit later.

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

3 participants