freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Re: Summary of ANSI preprocessor trouble..


From: David Turner
Subject: [Devel] Re: Summary of ANSI preprocessor trouble..
Date: Tue, 12 Dec 2000 16:23:21 +0100

Hi Werner,

> 
> Oops!  This would be unfortunate, and I had to undo some
> `beautifications'...  Please tell me.
> 

OK, I have performed lots of twisted tests. Your modifications still
didn't work with LCC-win32. I think I can explain why now:

  the following lines do not compile with LCC:

    #define  PATH(d,x)  <##d##/##x##>
    #define  MY_FILE_H   PATH(mydir,myfile)

  the compiler complains that ## produced an invalid _token_,
  named "<mydir". It seems that LCC really insists that
  _every_ concatenation creates a "valid" token, instead
  of checking only the end result.

  the following do work well with LCC however:

    #define  PATH(d,x)   <d/x>
    #define  MY_FILE_H   PATH(mydir,myfile)

  I could compile the whole of FreeType 2 after doing this little
  change to <freetype/config/ft2build.h> with this compiler. However,
  some other compilers will probably complain about it, or
  simply produce "<d/x>" instead of "<mydir/myfile>"

  I have thus tried something like:

    #define  ENCLOSE_IN_ANGLES(x)    <x>
    #define  INSERT_DIR_SEP(d,x)     d/x
    #define  PATH(d,x)               ENCLOSE_IN_ANGLES(INSERT_DIR_SEP(d,x))

  this scheme works with Win32-LCC, Gcc and Borland C++ (which is
  relatively ANSI anal) !! I was about to commit this change to the
  CVS.

  Unfortunately, your latest formatting changes make the code un-compilable
  with this method, at least with GCC, because you changed

     #define FT_SOURCE_FILE(path,file)

  to

     #define FT_SOURCE_FILE( path, file )  // note the extra spaces 
address@hidden

  I am now re-formatting everything, urggg.. :-(
  I'll commit the changes to the CVS then..

- David


 I have commited my changes to the CVS
  repository and will begin testing with Visual C++ as soon as I
  re-install it on my machine. Where's this old Watcom CD by the way ? ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]