freetype-devel
[Top][All Lists]
Advanced

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

Problems with freetype.h


From: Pedriana, Paul
Subject: Problems with freetype.h
Date: Mon, 22 May 2000 12:08:31 -0700

I have been working freetype BETA6 and today ran 
into the following serious problem which causes
freetype to be unusuable when used by C++ code.

freetype.h makes the following two declarations
(slightly reformatted for email):

   EXPORT_DEF(FT_Error) 
   FT_Outline_Get_Bitmap(FT_Library library,
      FT_Outline* outline, FT_Bitmap* map);


   EXPORT_DEF(void)
   FT_Vector_Transform(FT_Vector* vector,
      FT_Matrix* matrix);

These declarations cause compile failures under C++
because the names "map" and "matrix" are types that are
part of the C++ standard template library (STL). 
Now, technically speaking, the C++ standard states 
that map and vector, along with the other STL classes, 
belong in the "std" namespace and thus shouldn't 
conflict with types declared globally. However, the 
usage above is as a variable name and not a type name, 
and I am not sure how a C++ compiler would deal with 
that. However, one thing that is definitely a problem
is that there is a very large C++ code base that in 
fact uses STL classes in the global namespace. This is 
definately a problem and makes freetype break for me.

A trivial fix would be to simply modify the declarations
to use something like "map_" instead of "map", or whatever
would be appropriate for freetype. 

Thanks,

Paul





reply via email to

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