You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Tommi Vainikainen (JIRA)" <xe...@xml.apache.org> on 2010/02/15 10:43:27 UTC

[jira] Created: (XERCESC-1912) Conflicting includes cpuid.h and intrin.h (both define __cpuid)

Conflicting includes cpuid.h and intrin.h (both define __cpuid)
---------------------------------------------------------------

                 Key: XERCESC-1912
                 URL: https://issues.apache.org/jira/browse/XERCESC-1912
             Project: Xerces-C++
          Issue Type: Bug
          Components: Build
    Affects Versions: 3.1.0
         Environment: GCC 4.4 (mingw) with mingw-w64 environment (64-bit, cross-compiling under Debian GNU/Linux)
            Reporter: Tommi Vainikainen
            Priority: Minor


GCC (since 4.3 AFAIK) contains cpuid.h which defines _get_cpuid(...) and __cpuid(level, a, b, c, d).

intrin.h is Windows-API which defines __cpuid(int CPUInfo[4], int InfoType)

Definitions of __cpuid are clearly not compatible.

However when cross-compiling with GCC-mingw for Windows, configure script detects existence of both cpuid.h and intrin.h and includes both in PlatformUtils.cpp

Following trivial patch workarounds this problem.

diff -ur xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp
--- xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp	2009-08-28 16:21:24.000000000 +0300
+++ xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp	2010-02-15 11:16:33.000000000 +0200
@@ -37,7 +37,7 @@
 #if HAVE_SYS_TIMEB_H
 #	include <sys/timeb.h>
 #endif
-#if HAVE_CPUID_H
+#if HAVE_CPUID_H && !XERCES_HAVE_INTRIN_H
 #   include <cpuid.h>
 #endif
 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Closed: (XERCESC-1912) Conflicting includes cpuid.h and intrin.h (both define __cpuid)

Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov closed XERCESC-1912.
------------------------------------

      Assignee: Boris Kolpackov
    Resolution: Fixed

Fix is in SVN.

> Conflicting includes cpuid.h and intrin.h (both define __cpuid)
> ---------------------------------------------------------------
>
>                 Key: XERCESC-1912
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1912
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.1.0
>         Environment: GCC 4.4 (mingw) with mingw-w64 environment (64-bit, cross-compiling under Debian GNU/Linux)
>            Reporter: Tommi Vainikainen
>            Assignee: Boris Kolpackov
>            Priority: Minor
>             Fix For: 3.1.1, 3.2.0
>
>
> GCC (since 4.3 AFAIK) contains cpuid.h which defines _get_cpuid(...) and __cpuid(level, a, b, c, d).
> intrin.h is Windows-API which defines __cpuid(int CPUInfo[4], int InfoType)
> Definitions of __cpuid are clearly not compatible.
> However when cross-compiling with GCC-mingw for Windows, configure script detects existence of both cpuid.h and intrin.h and includes both in PlatformUtils.cpp
> Following trivial patch workarounds this problem.
> diff -ur xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp
> --- xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp	2009-08-28 16:21:24.000000000 +0300
> +++ xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp	2010-02-15 11:16:33.000000000 +0200
> @@ -37,7 +37,7 @@
>  #if HAVE_SYS_TIMEB_H
>  #	include <sys/timeb.h>
>  #endif
> -#if HAVE_CPUID_H
> +#if HAVE_CPUID_H && !XERCES_HAVE_INTRIN_H
>  #   include <cpuid.h>
>  #endif
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


[jira] Updated: (XERCESC-1912) Conflicting includes cpuid.h and intrin.h (both define __cpuid)

Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov updated XERCESC-1912:
-------------------------------------

    Fix Version/s: 3.2.0
                   3.1.1

Scheduling for 3.1.1 and 3.2.0. Thanks for the patch!

> Conflicting includes cpuid.h and intrin.h (both define __cpuid)
> ---------------------------------------------------------------
>
>                 Key: XERCESC-1912
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1912
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.1.0
>         Environment: GCC 4.4 (mingw) with mingw-w64 environment (64-bit, cross-compiling under Debian GNU/Linux)
>            Reporter: Tommi Vainikainen
>            Priority: Minor
>             Fix For: 3.1.1, 3.2.0
>
>
> GCC (since 4.3 AFAIK) contains cpuid.h which defines _get_cpuid(...) and __cpuid(level, a, b, c, d).
> intrin.h is Windows-API which defines __cpuid(int CPUInfo[4], int InfoType)
> Definitions of __cpuid are clearly not compatible.
> However when cross-compiling with GCC-mingw for Windows, configure script detects existence of both cpuid.h and intrin.h and includes both in PlatformUtils.cpp
> Following trivial patch workarounds this problem.
> diff -ur xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp
> --- xerces-c-3.1.0/src/xercesc/util/PlatformUtils.cpp	2009-08-28 16:21:24.000000000 +0300
> +++ xerces-c-3.1.0.patched/src/xercesc/util/PlatformUtils.cpp	2010-02-15 11:16:33.000000000 +0200
> @@ -37,7 +37,7 @@
>  #if HAVE_SYS_TIMEB_H
>  #	include <sys/timeb.h>
>  #endif
> -#if HAVE_CPUID_H
> +#if HAVE_CPUID_H && !XERCES_HAVE_INTRIN_H
>  #   include <cpuid.h>
>  #endif
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org