[cfe-commits] r65233 - in /cfe/trunk/lib: AST/ASTContext.cpp Analysis/CFRefCount.cpp

Cédric Venet cedric.venet at laposte.net
Sat Feb 21 10:16:58 PST 2009


Daniel Dunbar a écrit :
> On Sat, Feb 21, 2009 at 9:14 AM, Cedric Venet <cedric.venet at laposte.net> wrote:
>   
>> Author: venet
>> Date: Sat Feb 21 11:14:49 2009
>> New Revision: 65233
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=65233&view=rev
>> Log:
>> Fix build on windows.
>>
>> Should clang have a config.h or should we use the config.h of llvm or using the preprocessor is OK?  I did a quick fix here, but having a guideline on how to handle non portable function would be great (or ask ted to stop breaking the windows build :)).
>>     
>
> No on config.h.
>
> Generally portability issues should be handled by adding a portable
> API to llvm (for example, llvm::System which encapsulates the features
> needed. In this case the right place would be StringExtras.h, we
> already have StringEqualsNoCase, for example.
>
>   

Yes I was thinking to put it here at first, but was unsure if I should 
put a clang specific in the llvm files. I suppose that since the support 
api are commun to the two it is not  a problem...

Now, should I create a function StringEqualsNoCaseN (or 
StringCmpNoCaseSafe) or using a macro to define strncasecmp is fine?

regards,

Cédric


>  - Daniel
>
>   
>> Modified:
>>    cfe/trunk/lib/AST/ASTContext.cpp
>>    cfe/trunk/lib/Analysis/CFRefCount.cpp
>>
>> Modified: cfe/trunk/lib/AST/ASTContext.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=65233&r1=65232&r2=65233&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/AST/ASTContext.cpp (original)
>> +++ cfe/trunk/lib/AST/ASTContext.cpp Sat Feb 21 11:14:49 2009
>> @@ -2816,7 +2816,7 @@
>>     if (areCompatVectorTypes(LHS->getAsVectorType(), RHS->getAsVectorType()))
>>       return LHS;
>>     return QualType();
>> -  case Type::ObjCInterface:
>> +  case Type::ObjCInterface: {
>>     // Check if the interfaces are assignment compatible.
>>     const ObjCInterfaceType* LHSIface = LHS->getAsObjCInterfaceType();
>>     const ObjCInterfaceType* RHSIface = RHS->getAsObjCInterfaceType();
>> @@ -2825,6 +2825,7 @@
>>       return LHS;
>>
>>     return QualType();
>> +  }
>>   case Type::ObjCQualifiedId:
>>     // Distinct qualified id's are not compatible.
>>     return QualType();
>>
>> Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=65233&r1=65232&r2=65233&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
>> +++ cfe/trunk/lib/Analysis/CFRefCount.cpp Sat Feb 21 11:14:49 2009
>> @@ -35,6 +35,10 @@
>>
>>  using namespace clang;
>>
>> +#ifdef _MSC_VER
>> +#  define strncasecmp _strnicmp
>> +#endif // #ifdef _MSC_VER
>> +
>>  //===----------------------------------------------------------------------===//
>>  // Utility functions.
>>  //===----------------------------------------------------------------------===//
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>     
>
>   




More information about the cfe-commits mailing list