[Ffmpeg-devel] [PATCH] near is a special keyword

Ivan Kalvachev ikalvachev
Thu Mar 2 10:12:45 CET 2006


2006/3/1, Michael Niedermayer <michaelni at gmx.at>:
> Hi
>
> On Tue, Feb 28, 2006 at 03:42:26PM -1000, Steve Lhomme wrote:
> > ...on some windows compilers (far vs near pointers). So I renamed items
> > called "near".
>
> #define near smallandstinkingsoft_not_knowing_c_standard

I'm sorry but this might not work.
It seems that if the compiler have reserved special keyword it cannot
be redefined or undef-ed
Here I tried this small program with gcc
---
#include <stdlib.h>
#include <stdio.h>

//#undef for
#define for foobar
#undef for

int main(){
   int i;
   for(i=0;i<10;i++)
       printf("baka!\n");
}
---
The result, program compiles and runs just fine.

So if gcc does this I guess other inferiour compilers could do the same.





More information about the ffmpeg-devel mailing list