Updated openjpeg to 2.5.2 by radarhere · Pull Request #7837 · python-pillow/Pillow

From what I can see, OPJ_VERSION_MAJOR has been around since OpenJPEG 2.1.0 - so I think the comment meant 2.0.x, not 2.x.

So for this segment,

Pillow/src/libImaging/Jpeg2KDecode.c

Lines 671 to 675 in 0fc9b91

/* OpenJPEG 2.0 doesn't have OPJ_VERSION_MAJOR */
#ifndef OPJ_VERSION_MAJOR
opj_stream_set_user_data(stream, state);
#else
opj_stream_set_user_data(stream, state, NULL);

the intention is to call the earlier version of opj_stream_set_user_data for earlier OpenJPEG versions.