Help in generating dummy header file

i have an original.h and original.lib,i want to use makecint to incorprate it into the cint.
but when i trying to generate the dummy file,i met some problems:

1.the “#ifdef/#endif” statements

#ifdef __cplusplus
extern "C" {
#endif 

#ifndef BYTE
        #define BYTE unsigned char
#endif

in my opinion,there is no need to change it.
just use the makecint’s “-p” parameter to startup the preprocess.

2.macro function

#define GETMAJORCLASS(att)    (att & 0xF0000000)

in my opinion,it should changed to

long GETMAJORCLASS(long att);
#pragma link MACRO GETMAJORCLASS;

but should i implement the GETMAJORCLASS function in the cpp file?
or how could the cint know it?

3.enum

enum
{
    NODENAME = 10;
    NODETYPE = 11;
};

how could i transplant it into the dummy header?

4.struct

#define LEN 10
typedef struct tagA{
	tagA()
	{
	     memset(szName, 0, LEN);
	};

	char szName[LEN];
}B;

how could i change it to the dummy file? should i seperate the struct into the declaration and the implement.

dummyheader.h
#define LEN 10
typedef struct tagA
{
           tagA();
           char szName[LEN];
}B;

dummycpp.cpp
tagA::tagA()
{
     memset(szName, 0, LEN);
}

5.typedef statements

typedef A B;

am i right that i don’t need to change it in the dummy header?

6.the “#pragma link XXX;” statemens
should i use the “#pragma link XXX;” each time?

Hi,

  1. Indeed, use -p

  2. Can you change the code in the real header file? If not, you can switch from a macro to a function.
    If you use -p you will not be able to expose the macro directly, however you could use the following trick (note the different casing):long getmajorclass(long att); #pragma link C function getmajorclass;and in a source file:long getmajorclass(long att) { return GETMAJORCLASS(att); }

  3. You can try:#pragma link C global NODENAME; #pragma link C global NODETYPE;

  4. You should not need to separate the definition and implementation.

  5. Correct.

  6. It is usually best to explicit request each symbol you need.

Cheers,
Philippe.