Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

From: Roland Dreier (rdreier_at_[hidden])
Date: 2007-04-18 16:13:11

> The main problem came from the fact that if we want to use our
> modular approach on Windows (DLL loaded at runtime) we have to
> compile in C++ mode. The C++ compiler consider the types int and long
> as being different (even if they have the same number of bytes). No
> implicit cast is allowed by the VC compiler when in C++ mode.
> Therefore, we have to force an explicit cast everywhere.

I see... so the right way to right this is really:

        #ifdef __cplusplus
        #define ompi_cast_to_int(x) static_cast<int>(x)
        #define ompi_cast_to_int(x) (x)
                intval = ompi_cast_to_int(stroul(foo));

Right? ;)

 - R.