[Ffmpeg-devel] Re: [PATCH] MinGW and portability

Rich Felker dalias
Wed Mar 29 19:16:22 CEST 2006

On Wed, Mar 29, 2006 at 09:50:48AM +0100, M?ns Rullg?rd wrote:
> Frantisek Dvorak said:
> >>> +#ifdef AVFORMAT_COMPILE
> >>> +#  define _DL_IMPORT_AVFORMAT
> >>> +#else
> >>> +#endif
> >>
> >> What's this all about?  People are compiling and using ffmpeg on
> >> windows all the time without any mess like this.
> >>
> >
> > With compiling ffmpeg Windoze users are forced to use recent MinGW or
> If you want to use new software you have to be prepared to use new compilers.
> End of story.

Forced upgrades are evil, but crap that requires you to work around
all kinds of bugs and nonportable constructs is even more evil.

> > Comments to Rich Felker:
> >
> >> This patch was already rejected once before. The solution is to add
> >> the equivalent of -Dnear=msvc_sucks_near to your build options, not to
> >> invasively alter valid C code to workaround MS bugs.
> >
> > Cute trick. I'll use it thanks. (btw. not only M$VC, whole WIN32 sucks
> > near :-), maybe should be used in ffmpeg configure too...)

No idea what he means by "whole WIN32". I seriously doubt gcc includes
this nonsense. If it does they gcc developers are even stupider than I
thought (and it's very difficult to be stupider than I already thought
they were...).

> I always thought "near" and "far" pointers were a thing of 16-bit segmented
> memory models.  Win32 is supposed to use a linear memory model, no?

They're a thing of x86 segment registers. On 16bit crap it was
necessary to use them all the time (unless you said screw performance
and used the 'huge' memory model, where all pointers were fake 32bit
pointers with segment and offset combined into the upper and lower
halfwords) unless your program was only 64k. Possible reasons MS left
them in place for win32:

- to avoid breaking code that stupidly uses them for no reason (making
  them no-op?).
- to allow same headers to be shared between win16 and win32.
- to allow them to use this crap in developing the os, device drivers,
  etc. (where you want to be able to use segment registers sometime)

I have no idea which.


More information about the ffmpeg-devel mailing list