Skip to content

Commit

Permalink
Fix MinGW builds
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Oct 12, 2024
1 parent 184e8c0 commit e41b426
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Quake/Makefile.w32
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ endif
ifeq ($(MP3LIB),mpg123)
mp3_obj=snd_mpg123
lib_mp3dec=-lmpg123
CFLAGS += -DMPG123_NO_LARGENAME=1
endif
ifeq ($(VORBISLIB),vorbis)
cpp_vorbisdec=
Expand Down
1 change: 1 addition & 0 deletions Quake/Makefile.w64
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ endif
ifeq ($(MP3LIB),mpg123)
mp3_obj=snd_mpg123
lib_mp3dec=-lmpg123
CFLAGS += -DMPG123_NO_LARGENAME=1
endif
ifeq ($(VORBISLIB),vorbis)
cpp_vorbisdec=
Expand Down

3 comments on commit e41b426

@sezero
Copy link

@sezero sezero commented on e41b426 Oct 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just define MPG123_NO_LARGENAME in snd_mpg123.c before including mpg123.h and be done with it, instead?

@andrei-drexler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might also work, but I'm not sure of the implications of calling mpg123 functions with no suffix (which might expect 32-bit offsets even on 64-bit systems) from code that defines _FILE_OFFSET_BITS=64 (making off_t 64-bit), so I figured I'd only define that macro if absolutely necessary. This whole 64-bit offset situation is pretty messy, though.

@sezero
Copy link

@sezero sezero commented on e41b426 Oct 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using our own callbacks for file i/o, therefore I think file offset bits with mpg123 is pointless here. So I went ahead and defined MPG123_NO_LARGENAME in snd_mpg123.c in qs.

And yes, the 64 bit offset is a real mess in mpg123.

Please sign in to comment.