Skip to content

[Bug]: JUCE_INCLUDE_JPEGLIB_CODE does not prevent the inclusion of juce_graphics/image_formats/jpglib/jdhuff.c #1690

Description

@fbecir

Detailed steps on how to reproduce the bug

In a project using its own version of LibJpeg with the code of jdhuff.c, there is a link error even if JUCE_INCLUDE_JPEGLIB_CODE = 0

In juce_graphics_libjpg_1.c, the JUCE_INCLUDE_JPEGLIB_CODE flag does not cover all the code.
The last lines are always included :
#define savable_state dedup_savable_state
#define huff_entropy_ptr dedup_huff_entryopy_ptr
#define finish_pass_huff dedup_finish_pass_huff
#include "juce_graphics/image_formats/jpglib/jdhuff.c"
#undef savable_state
#undef huff_entropy_ptr
#undef finish_pass_huff

What is the expected behaviour?

JUCE_INCLUDE_JPEGLIB_CODE = 0 should prevent the link error

Operating systems

Windows

What versions of the operating systems?

Windows 11

Architectures

x86 (Windows, Android)

Stacktrace

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions