On Thu, Dec 17, 2009 at 8:56 PM, Lisandro Dalcín <[email protected]> wrote:
> On Thu, Dec 17, 2009 at 8:38 PM, Robert Bradshaw
> <[email protected]> wrote:
>> On Dec 17, 2009, at 2:40 PM, Lisandro Dalcín wrote:
>>
>>> On Thu, Dec 17, 2009 at 12:25 PM, Julien Danjou <[email protected]>
>>> wrote:
>>>> This kills a compilation warning.
>>>>
>>>> Signed-off-by: Julien Danjou <[email protected]>
>>>> ---
>>>>  Cython/Compiler/Nodes.py |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
>>>> index e6b0048..dfe94d6 100644
>>>> --- a/Cython/Compiler/Nodes.py
>>>> +++ b/Cython/Compiler/Nodes.py
>>>> @@ -4822,7 +4822,7 @@ utility_function_predeclarations = \
>>>>  """
>>>>  #ifdef __GNUC__
>>>>  #define INLINE __inline__
>>>> -#elif _WIN32
>>>> +#elif defined(_WIN32)
>>>>  #define INLINE __inline
>>>>  #else
>>>>  #define INLINE
>>>> --
>>>> 1.6.5.4
>>>>
>>>
>>> Mmm... What about the fix below? IIUC, __inline is a builtin keyword
>>> for MSVC, but not for every other C compiler running on Windows...
>>> Better safe than sorry...
>>>
>>>
>>> $ hg diff Cython/Compiler/Nodes.py
>>> diff -r d76177fc0796 Cython/Compiler/Nodes.py
>>> --- a/Cython/Compiler/Nodes.py        Thu Dec 17 09:32:44 2009 +0100
>>> +++ b/Cython/Compiler/Nodes.py        Thu Dec 17 19:38:15 2009 -0300
>>> @@ -4820,9 +4820,9 @@
>>>
>>> utility_function_predeclarations = \
>>> """
>>> -#ifdef __GNUC__
>>> +#if defined(__GNUC__)
>>> #define INLINE __inline__
>>> -#elif _WIN32
>>> +#elif defined(_MSC_VER)
>>> #define INLINE __inline
>>> #else
>>> #define INLINE
>>
>
>> Good point, please push. Are there any other compilers that we should
>> single out? We heavily use the assumption that inlined functions
>> actually get inlined for optimization purposes.
>>
>
> Intel? PathScale? PGI? Borland? (Open) Watcom?
>
> I can do it for Intel and PathScale ...
>

BTW, we should protect all these definitions of INLINE inside an outer
#ifndef INLINE ... #endif. That way, in the face of a compiler Cython
is not aware of, we can pass -DINLINE=something and make it work. What
do you think?


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to