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

Does not compile with markdown3 #682

Open
Esokrates opened this issue Apr 1, 2023 · 5 comments · May be fixed by #716
Open

Does not compile with markdown3 #682

Esokrates opened this issue Apr 1, 2023 · 5 comments · May be fixed by #716

Comments

@Esokrates
Copy link

Expected Behaviour

Project should build successfully using latest vala version.

Actual Behaviour

Compilation fails with message

pdfpc-4.6.0/build/src/classes/renderer/markdown.c:191:20: error: variable or field 'flags' declared void

see the following build log against Opensuse Tumbleweed:
https://build.opensuse.org/build/home:esokrates/openSUSE_Tumbleweed/x86_64/pdfpc/_log

Steps to reproduce

  1. Try to build version 4.5.0 or 4.6.0 on Opensuse Tumbleweed.
  2. Observe that the build fails.

pdfpc version: 4.6.0
Used Distribution (GTK version, Vala version): Opensuse Tumbleweed, vala 0.56.5
Display Server (X11/Wayland): does not matter (build error)
HiDPI Setting (yes/no): does not matter (build error)

@Esokrates
Copy link
Author

@fnevgeny
Copy link
Member

fnevgeny commented Apr 1, 2023

Can you show what is at line 191 of pdfpc-4.6.0/build/src/classes/renderer/markdown.c?

@fnevgeny
Copy link
Member

fnevgeny commented Apr 6, 2023

The problem is with libmarkdown3 which is not backward-compatible with libmarkdown2, see Orc/discount/issues/213. We list markdown2 specifically.

@fnevgeny fnevgeny changed the title Does not compile anymore with vala 0.56.5 Does not compile with markdown3 Apr 6, 2023
@Orc
Copy link

Orc commented Feb 7, 2024

Yes, I changed the flags format because I ran out of bits in the old version. already compiled code should work with the new libraries (I wedged a v2compat layer in) but new code needs to use the new flags structure. I apologize for it not actually being documented; I've been transitioning and between it and the previous wave of dysphoria I've been running at about 1/10th of my abilities for the last couple of years.)

The tl/dr; of the new flags is that flags are now a mkd_flag_t*, which need to be allocated with the function mkd_flags() and, when you're done, deallocated with mkd_free_flags(mkd_flag_t*), like so:

main()
{
    mkd_flags_t *flags = mkd_flags();

    if ( flags == NULL ) { perror(errno); exit(1); }

    /* ... do the usual; markdown stuff; all the mkd_ functions that previously
        expected a mkd_flag_t flags argument  now expect a mkd_flag_t pointer,
        so if the flags are allocated like this they will just fall into the existing
        code  */

    mkd_free_flags(flags);
}

wentasah added a commit to wentasah/pdfpc that referenced this issue Apr 17, 2024
Currently compilation fails with:

    /build/src/classes/renderer/markdown.c:191:20: error: variable or field 'flags' declared void

According to comment [1], markdown3 introduces backward
incompatibility with respect to document flags.

This commit adds conditionally compiled code that allows building
pdfpc with both markdown versions 2 and 3.

Fixes pdfpc#682

[1]: pdfpc#682 (comment)
@wentasah wentasah linked a pull request Apr 17, 2024 that will close this issue
wentasah added a commit to wentasah/pdfpc that referenced this issue Apr 17, 2024
Currently compilation fails with:

    /build/src/classes/renderer/markdown.c:191:20: error: variable or field 'flags' declared void

According to comment [1], markdown3 introduces backward
incompatibility with respect to document flags.

This commit adds conditionally compiled code that allows building
pdfpc with both markdown versions 2 and 3.

The used cmake operator VERSION_GREATER_EQUAL requires cmake 3.7 so we
bump minimal cmake version requirement.

Fixes pdfpc#682

[1]: pdfpc#682 (comment)
wentasah added a commit to wentasah/pdfpc that referenced this issue Apr 17, 2024
Currently compilation fails with:

    /build/src/classes/renderer/markdown.c:191:20: error: variable or field 'flags' declared void

According to comment [1], markdown3 introduces backward
incompatibility with respect to document flags.

This commit adds conditionally compiled code that allows building
pdfpc with both markdown versions 2 and 3.

The used cmake operator VERSION_GREATER_EQUAL requires cmake 3.7 so we
bump minimal cmake version requirement.

Fixes pdfpc#682

[1]: pdfpc#682 (comment)
@wentasah
Copy link
Contributor

Possible fix is in #716. @Orc thanks for the hint what needed to be changed.

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

Successfully merging a pull request may close this issue.

4 participants