Turn CCTK_REAL8 etc. into typedefs

Create issue
Issue #1538 closed
Erik Schnetter created an issue

Currently, CCTK_REAL8 are #defines. This is inconvenient, since e.g. CCTK_REAL16 may be "long double", and the C++ syntax

CCTK_REAL16(x)

is then illegal, since this expands to "long double(x)". Turning CCTK_REAL8 and friends into proper typedefs remedies this.

The attached patch also corrects two small issues in cctk_Types.h: (1) The include guard around "cctk_Config.h" should not be there, and (2) some #endifs have wrong comments.

Keyword:

Comments (9)

  1. Roland Haas
    • changed status to open
    • removed comment

    The typedefs look fine. Did you also fix an issue with the last #endif in the file not really being include guard but the one belonging to HAVE_CCTK_C_ATTRIBUTE_UNUSED? That had me initially confused reviewing the patch.

  2. Roland Haas
    • removed comment

    Hmm. Fails to compile after I applied the patch.

    /mnt/data/rhaas/postdoc/gr/Zelmani/src/include/cctk_Types.h:96:1: error: unknown type name 'CCTK_INT1_TYPE'
     typedef CCTK_INT1_TYPE CCTK_INT1;
     ^
    

    I assume a -realclean will fix this but it should not be required I think since we already ask for a -reconfig.

    Correction: apparently I have to run autoconf on it since configure needs to be updated.

  3. Erik Schnetter reporter
    • removed comment

    Yes, I also corrected a mixup with #endifs in cctk_Types.h.

    Did you also regenerate "configure"? I didn't include this into the patch.

  4. Roland Haas
    • removed comment

    Yes, I regenerated configure. I would not compile before (lots of errors since the types were not defined). I also found out why you had all those commits change #ifdef CCTK_REAL4 to #ifdef HAVE_CCTK_REAL4 :-). Since I had not put in the magic words explicitly in the previous review:

    Please apply.

  5. Roland Haas
    • removed comment

    I had to regenerate configure and updated my comment. However since editing a comment does not trigger an email I guess this was lost to the mailing list.

  6. Log in to comment