Skip to contentSkip to conversation

conflict in public header for values definitions

DISCUSSION Igor Kozhukhov 4 participants 5 messages Jan 3, 2014 – Jan 7, 2014

lore
Share & tools
lore
#0 lore raw

Hello All,

I'm working on port xen-4.2 to illumos based platform - DilOS - and have problems with conflicts for:

xen/include/public/trace.h :

struct t_buf {}
struct t_info {}

I have a questions - can we rename structures to:
struct t_buf_xen {}
struct t_info_xen {}

Will it be applicable for Xen sources ?
if yes - i can update Xen sources by new variables and provide changes to review.

it will help with next Xen ports without changes in public headers.

--
Best regards,
Igor Kozhukhov

#1 lore raw
Quoted 6 lines · Igor Kozhukhov

Hello All,

I'm working on port xen-4.2 to illumos based platform - DilOS - and have problems with conflicts for:

xen/include/public/trace.h :

Quoted 8 lines

struct t_buf {}
struct t_info {}

I have a questions - can we rename structures to:
struct t_buf_xen {}
struct t_info_xen {}

Will it be applicable for Xen sources ?

You would break the compilation for every other user of trace.h, so no.

If it conflicts with something locally, you could do something like:
(completely untested)

#define t_buf t_buf_xen
#include <public/trace.h>
#undef t_buf

And use t_buf_xen in your own code.

~Andrew

#2 lore raw

Hi Andrew,

it is impossible to do outside public headers, because we have trace.h included to another public readers - for example: xen/public/hvm/hvm_op.h

will be better to have committed changes in public headers for next ports without additional changes in sources.

is it possible to add '#ifdef __sun' to public headers ? I can try to do it and provide review ?
or i need update public headers in illumos tree every time ?

--
Best regards,
Igor Kozhukhov

Quoted 29 lines · Andrew Cooper
Quoted 6 lines · Igor Kozhukhov

Hello All,

I'm working on port xen-4.2 to illumos based platform - DilOS - and have problems with conflicts for:

xen/include/public/trace.h :

Quoted 8 lines

struct t_buf {}
struct t_info {}

I have a questions - can we rename structures to:
struct t_buf_xen {}
struct t_info_xen {}

Will it be applicable for Xen sources ?

You would break the compilation for every other user of trace.h, so no.

If it conflicts with something locally, you could do something like:
(completely untested)

#define t_buf t_buf_xen
#include <public/trace.h>
#undef t_buf

And use t_buf_xen in your own code.

~Andrew

#3 lore raw
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Igor Kozhukhov

it is impossible to do outside public headers, because we have trace.h included to another public readers - for example: xen/public/hvm/hvm_op.h

Just create suitable wrapper headers for any such instance.

Quoted 4 lines

will be better to have committed changes in public headers for next ports without additional changes in sources.

is it possible to add '#ifdef __sun' to public headers ?

Not if there's a better way. Yes, I agree that the lack of xen_ prefixes in various places is unfortunate, but I don't see why you shouldn't be able to cope if everyone else can.

Jan

#4 lore raw
In reply to Igor Kozhukhov
Quoted 8 lines · Igor Kozhukhov

Hello All,

I'm working on port xen-4.2 to illumos based platform - DilOS - and have problems with conflicts for:

xen/include/public/trace.h :

struct t_buf {}
struct t_info {}

What do these conflict with? Is it user or kernel space? Please can you provide the full build error for context.

Ian.