From: GiuseppeDini on
in a header file i've found this line:

CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );

What does it mean?
It is a strange function declaration.

It seems "CVAPI(void)" is treated like a type.


Giuseppe
From: Ben Bacarisse on
GiuseppeDini <vvene(a)libero.it> writes:

> in a header file i've found this line:
>
> CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );
>
> What does it mean?
> It is a strange function declaration.
>
> It seems "CVAPI(void)" is treated like a type.

CVAPI will turn out to be a macro. It will, most likely, take the
type and add various system specific decorations to it -- probably
controlled by other macro settings.

--
Ben.
From: asm23 on
GiuseppeDini wrote:
> in a header file i've found this line:
>
> CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );
>
> What does it mean?
> It is a strange function declaration.
>
> It seems "CVAPI(void)" is treated like a type.
>
>
> Giuseppe
HI, I think your question is related to OPENCV.
As, in OpenCV, there are many function prototype which contains "CVAPI".
such as:

CVAPI(int) cvInitSystem( int argc, char** argv );
CVAPI(int) cvStartWindowThread();

And, CVAPI is a macro define by:
#define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL

So, you can find the term "CV_EXTERN" "CV_EXPORTS" and "CV_CDECL" are
also macros. These macros just define the linkage, the calling
conversion and so on.

I think you can understand what I have explained. Good Luck!
From: GiuseppeDini on
On 12 Set, 06:21, asm23 <asmwarr...(a)gmail.com> wrote:
> GiuseppeDini wrote:
> > in a header file i've found this line:
>
> > CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );
>
> > What does it mean?
> > It is a strange function declaration.
>
> > It seems "CVAPI(void)" is treated like a type.
>
> >       Giuseppe
>
> HI, I think your question is related to OPENCV.
> As, in OpenCV, there are many function prototype which contains "CVAPI".
> such as:
>
> CVAPI(int) cvInitSystem( int argc, char** argv );
> CVAPI(int) cvStartWindowThread();
>
> And, CVAPI is a macro define by:
> #define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL
>
> So, you can find the term "CV_EXTERN" "CV_EXPORTS" and "CV_CDECL" are
> also macros. These macros just define the linkage, the calling
> conversion and so on.
>
> I think you can understand what I have explained. Good Luck!

Yes thank you.
I'm new to c++, but I can understand.
I didn't know that there could macro of macros.

Giuseppe
 | 
Pages: 1
Prev: solution manual
Next: Why does this segfault?