[ofa-general] Re: [ib-mgmt] duplicate definitions

Sasha Khapyorsky sashak at voltaire.com
Fri Jan 30 06:28:24 PST 2009


Hi Sean,

On 22:29 Thu 29 Jan     , Sasha Khapyorsky wrote:
> On 11:35 Thu 29 Jan     , Sean Hefty wrote:
> > 
> > Stan came across an issue while porting saquery to Windows resulting from
> > duplicate definitions for IB_MAD_METHOD_*.  These are defined as enums in mad.h,
> > but as #define values in ib_types.h.
> 
> Why it should be a problem? ib_types.h is included in saquery.c after
> mad.h and as far as I understand "defines" will work instead of "enums".
> Opposite inclusion order could cause the problem of course.

BTW is it true that WinOF uses its own version of ib_types.h?

A lot of time ago I posted patch (below) which removes '#ifdef *WIN*'
stuff there. Would be interested to know is it relevant yet?

Sasha


commit 467537604b56df11d8eec6cbf2fcb8d3963a6afc
Author: Sasha Khapyorsky <sashak at voltaire.com>
Date:   Fri Nov 30 06:20:13 2007 +0200

    opensm/ib_types.h: remove ifdef WIN conditions
    
    It was stated couple of times that in windows another instance of
    ib_types.h file is used. If so we don't need to keep those 'ifdef WIN'
    conditions here. Also this removes empty __ptr64 macro.
    
    Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>

diff --git a/opensm/include/iba/ib_types.h b/opensm/include/iba/ib_types.h
index 09ec257..821c4c9 100644
--- a/opensm/include/iba/ib_types.h
+++ b/opensm/include/iba/ib_types.h
@@ -49,20 +49,9 @@
 #endif				/* __cplusplus */
 
 BEGIN_C_DECLS
-#if defined( WIN32 ) || defined( _WIN64 )
-#if defined( EXPORT_AL_SYMBOLS )
-#define OSM_EXPORT	__declspec(dllexport)
-#else
-#define OSM_EXPORT	__declspec(dllimport)
-#endif
-#define OSM_API __stdcall
-#define OSM_CDECL __cdecl
-#else
 #define OSM_EXPORT	extern
 #define OSM_API
 #define OSM_CDECL
-#define __ptr64
-#endif
 /****h* IBA Base/Constants
 * NAME
 *	Constants
@@ -8255,22 +8244,21 @@ typedef struct _ib_ioc_info {
 /*
  *	The following definitions are shared between the Access Layer and VPD
  */
-typedef struct _ib_ca *__ptr64 ib_ca_handle_t;
-typedef struct _ib_pd *__ptr64 ib_pd_handle_t;
-typedef struct _ib_rdd *__ptr64 ib_rdd_handle_t;
-typedef struct _ib_mr *__ptr64 ib_mr_handle_t;
-typedef struct _ib_mw *__ptr64 ib_mw_handle_t;
-typedef struct _ib_qp *__ptr64 ib_qp_handle_t;
-typedef struct _ib_eec *__ptr64 ib_eec_handle_t;
-typedef struct _ib_cq *__ptr64 ib_cq_handle_t;
-typedef struct _ib_av *__ptr64 ib_av_handle_t;
-typedef struct _ib_mcast *__ptr64 ib_mcast_handle_t;
+typedef struct _ib_ca * ib_ca_handle_t;
+typedef struct _ib_pd * ib_pd_handle_t;
+typedef struct _ib_rdd * ib_rdd_handle_t;
+typedef struct _ib_mr * ib_mr_handle_t;
+typedef struct _ib_mw * ib_mw_handle_t;
+typedef struct _ib_qp * ib_qp_handle_t;
+typedef struct _ib_eec * ib_eec_handle_t;
+typedef struct _ib_cq * ib_cq_handle_t;
+typedef struct _ib_av * ib_av_handle_t;
+typedef struct _ib_mcast * ib_mcast_handle_t;
 
 /* Currently for windows branch, use the extended version of ib special verbs struct
 	in order to be compliant with Infinicon ib_types; later we'll change it to support
 	OpenSM ib_types.h */
 
-#ifndef WIN32
 /****d* Access Layer/ib_api_status_t
 * NAME
 *	ib_api_status_t
@@ -10712,8 +10700,4 @@ typedef struct _ib_ci_op {
 *****/
 
 END_C_DECLS
-#endif				/* ndef WIN32 */
-#if defined( __WIN__ )
-#include <iba/ib_types_extended.h>
-#endif
 #endif				/* __IB_TYPES_H__ */



More information about the general mailing list