[erfa] 01/03: Upstream release 1.0.0

Ole Streicher olebole-guest at alioth.debian.org
Sun Oct 27 13:22:58 UTC 2013


This is an automated email from the git hooks/post-receive script.

olebole-guest pushed a commit to branch debian
in repository erfa.

commit a9ddb78a1f981c617f9f5cdb46e2178567b95c42
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Sat Oct 26 18:17:08 2013 +0200

    Upstream release 1.0.0
---
 .gitignore     |    2 ++
 README.rst     |   41 ++++++++++++++++++++++++++++++------
 RELEASE.rst    |   45 ++++++++++++++++++++++++++++++++-------
 configure.ac   |    2 +-
 src/a2af.c     |    2 +-
 src/a2tf.c     |    2 +-
 src/af2a.c     |    2 +-
 src/anp.c      |    4 ++--
 src/anpm.c     |    4 ++--
 src/bi00.c     |    6 +++---
 src/bp00.c     |   10 ++++-----
 src/bp06.c     |    2 +-
 src/d2dtf.c    |    2 +-
 src/d2tf.c     |   12 +++++------
 src/dtdb.c     |   14 ++++++-------
 src/dtf2d.c    |    2 +-
 src/eect00.c   |    4 ++--
 src/eform.c    |   14 ++++++-------
 src/epb.c      |    2 +-
 src/epb2jd.c   |    2 +-
 src/epj.c      |    2 +-
 src/epv00.c    |    6 +++---
 src/eqeq94.c   |    8 +++----
 src/era00.c    |    4 ++--
 src/erfam.h    |   64 ++++++++++++++++++++++++++++----------------------------
 src/fad03.c    |    2 +-
 src/fae03.c    |    2 +-
 src/faf03.c    |    2 +-
 src/faju03.c   |    2 +-
 src/fal03.c    |    2 +-
 src/falp03.c   |    2 +-
 src/fama03.c   |    2 +-
 src/fame03.c   |    2 +-
 src/fane03.c   |    2 +-
 src/faom03.c   |    2 +-
 src/fasa03.c   |    2 +-
 src/faur03.c   |    2 +-
 src/fave03.c   |    2 +-
 src/fk5hip.c   |   12 +++++------
 src/fk5hz.c    |    2 +-
 src/gc2gd.c    |    8 +++----
 src/gc2gde.c   |    4 ++--
 src/gd2gc.c    |    8 +++----
 src/gd2gce.c   |    2 +-
 src/gmst00.c   |    4 ++--
 src/gmst06.c   |    4 ++--
 src/gmst82.c   |    8 +++----
 src/hfk5z.c    |    2 +-
 src/nut00a.c   |   22 +++++++++----------
 src/nut00b.c   |   20 +++++++++---------
 src/nut06a.c   |    2 +-
 src/nut80.c    |   14 ++++++-------
 src/obl06.c    |    4 ++--
 src/obl80.c    |    4 ++--
 src/p06e.c     |   32 ++++++++++++++--------------
 src/pb06.c     |    2 +-
 src/pfw06.c    |    8 +++----
 src/plan94.c   |   12 +++++------
 src/pmat76.c   |    2 +-
 src/pn06.c     |    2 +-
 src/pr00.c     |    6 +++---
 src/prec76.c   |    6 +++---
 src/pvstar.c   |   12 +++++------
 src/s00.c      |    4 ++--
 src/s06.c      |    4 ++--
 src/sp00.c     |    4 ++--
 src/starpm.c   |    4 ++--
 src/starpv.c   |   14 ++++++-------
 src/t_erfa_c.c |   18 ++++++++--------
 src/taitt.c    |    2 +-
 src/taiut1.c   |    2 +-
 src/taiutc.c   |    6 +++---
 src/tcbtdb.c   |   10 ++++-----
 src/tcgtt.c    |    6 +++---
 src/tdbtcb.c   |    8 +++----
 src/tdbtt.c    |    2 +-
 src/tf2a.c     |    2 +-
 src/tf2d.c     |    2 +-
 src/tttai.c    |    2 +-
 src/tttcg.c    |    8 +++----
 src/tttdb.c    |    2 +-
 src/ttut1.c    |    2 +-
 src/ut1tai.c   |    2 +-
 src/ut1tt.c    |    2 +-
 src/ut1utc.c   |    6 +++---
 src/utctai.c   |    4 ++--
 src/xy06.c     |    6 +++---
 87 files changed, 335 insertions(+), 273 deletions(-)

diff --git a/.gitignore b/.gitignore
index ba8d157..05835a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,5 @@
 *~
 Makefile
 Makefile.in
+/build-aux
+src/t_erfa_c
diff --git a/README.rst b/README.rst
index d17fa90..607aee8 100644
--- a/README.rst
+++ b/README.rst
@@ -13,16 +13,22 @@ in this source distribution.
 Differences from SOFA
 ---------------------
 
-This version of ERFA (v0.0.1) is based on SOFA version "20120301_a", with the 
+This version of ERFA (v1.0.0) is based on SOFA version "20120301_a", with the 
 differences outlined below.
 
-ERFA Branding
+ERFA branding
 ^^^^^^^^^^^^^
 
 All references to "SOFA" in the source code have been changed to ERFA, and 
 functions have the prefix ``era`` instead of ``iau``. 
 
-Building and Installing ERFA
+C macro prefixes
+^^^^^^^^^^^^^^^^ 
+
+All C macros used in ERFA are the same as their SOFA equivalents, but with an
+``ERFA_`` prefix to prevent namespace collisions.
+
+Building and installing ERFA
 ----------------------------
 
 To build and install a released version of ERFA in your OS's standard 
@@ -32,17 +38,40 @@ location, simply do::
     make
     make install
 
-For Developers
+If you want to run the tests to make sure ERFA built correctly, before
+installing do::
+
+    make check
+
+
+For developers
 ^^^^^^^^^^^^^^
 
 If you are using a developer version from github, you will need to first do
-``./bootstrap.sh`` before the above commands.
+``./bootstrap.sh`` before the above commands. This requires ``autoconf`` and 
+``libtool``.
 
 If you wish to build against the ERFA static library without installing, you
 will find it in ``$ERFAROOT/src/.libs/liberfa.a`` after running ``make``.
 
+Creating a single-file version of the source code
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Travis Build Status
+Alternatively, if you wish to bundle the ERFA source code with a separate 
+package, you can use the ``source_flattener.py`` script from the 
+`erfa-fetch repository`_ to combine
+the ERFA source code into just two files: a ``erfa.c`` source file, and an 
+``erfa.h`` include file.  You should run this script like this::
+
+    cd /path/to/erfa-source-code
+    python /path/to/erfa-fetch/source_flattener.py src -n erfa
+
+If possible, however, it is recommended that you provide an option to use any
+copy of the ERFA library that is already installed on the system.
+
+Travis build status
 -------------------
 .. image:: https://travis-ci.org/liberfa/erfa.png
     :target: https://travis-ci.org/liberfa/erfa
+
+.. _erfa-fetch repository: https://github.com/liberfa/erfa-fetch
\ No newline at end of file
diff --git a/RELEASE.rst b/RELEASE.rst
index a4158b7..b025b1f 100644
--- a/RELEASE.rst
+++ b/RELEASE.rst
@@ -1,6 +1,6 @@
 
-Instructions for Doing A Release of ERFA
-========================================
+Instructions for releasing ERFA
+===============================
 
 * Clone the ERFA repository from github (if you haven't already done so),
   and change to the ERFA directory.
@@ -9,6 +9,12 @@ Instructions for Doing A Release of ERFA
   repository and have the latest version (if you have a fresh clone, this
   should already be the case).
 
+* If a new version of SOFA exists, run `sofa_deriver.py` from the `erfa-fetch
+  repository`_ in its own directory.  That will create a directory called `erfa`
+  inside the `erfa-fetch` directory, and   you should copy its contents to the 
+  `src` directory of `erfa`.  Use ``git diff`` in `erfa` to inspect the changes, 
+  and then commit and push them to github.
+
 * Update the version number in the `AC_INIT` macro of `configure.ac` to
   the version number you are about to release, and also update the version 
   mentioned in `README.rst`. 
@@ -42,8 +48,33 @@ Instructions for Doing A Release of ERFA
   "releases" button, and then the release corresponding to the tag you just 
   made. 
 
-* Click on the "Draft release notes or downloads".  Leave the title and
-  description blank (the release notes should be in the ``README.rst``),
-  but upload the tarball you created (e.g., `erfa-0.0.1.tar.gz`) by 
-  dropping it in the area that says "Attach binaries for this release 
-  by dropping them here." Click the "Publish release" button.
\ No newline at end of file
+* Click on the "Draft release notes or downloads".  Put the version number as
+  the title (e.g., ``v0.0.1``)and for the description put 
+  ``See `README.rst` for release notes.``
+
+* Upload the tarball you created (e.g., `erfa-0.0.1.tar.gz`) by dropping it
+  in the area that says "Attach binaries for this release  by dropping them 
+  here." 
+
+* Click the "Publish release" button.
+
+* Update the release listing on Github Pages to include this release:
+  Do ``git checkout gh-pages``, add a new ``<li>...</li>`` entry for the
+  release in `index.html`, do ``git commit``, and then
+  ``git push origin gh-pages``.
+
+Version numbering
+=================
+
+ERFA uses `semantic versioning <http://semver.org/>`_.
+
+  Given a version number MAJOR.MINOR.PATCH, increment the:
+
+  * MAJOR version when you make incompatible API changes
+  * MINOR version when you add functionality in a backwards-compatible manner
+  * PATCH version when you make backwards-compatible bug fixes
+  
+For more on this choice, see 
+`liberfa/erfa#6 <https://github.com/liberfa/erfa/issues/6>`_.
+
+.. _erfa-fetch repository: https://github.com/liberfa/erfa-fetch
diff --git a/configure.ac b/configure.ac
index 7c8ac6d..f69752a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.68])
-AC_INIT([erfa],[0.0.1])
+AC_INIT([erfa],[1.0.0])
 AC_CONFIG_SRCDIR([src/erfa.h])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
diff --git a/src/a2af.c b/src/a2af.c
index a8e2e0f..03337c4 100644
--- a/src/a2af.c
+++ b/src/a2af.c
@@ -56,7 +56,7 @@ void eraA2af(int ndp, double angle, char *sign, int idmsf[4])
 */
 {
 /* Hours to degrees * radians to turns */
-   const double F = 15.0 / D2PI;
+   const double F = 15.0 / ERFA_D2PI;
 
 
 /* Scale then use days to h,m,s function. */
diff --git a/src/a2tf.c b/src/a2tf.c
index dea07f8..7b79db2 100644
--- a/src/a2tf.c
+++ b/src/a2tf.c
@@ -56,7 +56,7 @@ void eraA2tf(int ndp, double angle, char *sign, int ihmsf[4])
 */
 {
 /* Scale then use days to h,m,s function. */
-   eraD2tf(ndp, angle/D2PI, sign, ihmsf);
+   eraD2tf(ndp, angle/ERFA_D2PI, sign, ihmsf);
 
    return;
 
diff --git a/src/af2a.c b/src/af2a.c
index eade030..fb26657 100644
--- a/src/af2a.c
+++ b/src/af2a.c
@@ -43,7 +43,7 @@ int eraAf2a(char s, int ideg, int iamin, double asec, double *rad)
    *rad  = ( s == '-' ? -1.0 : 1.0 ) *
            ( 60.0 * ( 60.0 * ( (double) abs(ideg) ) +
                              ( (double) abs(iamin) ) ) +
-                                        fabs(asec) ) * DAS2R;
+                                        fabs(asec) ) * ERFA_DAS2R;
 
 /* Validate arguments and return status. */
    if ( ideg < 0 || ideg > 359 ) return 1;
diff --git a/src/anp.c b/src/anp.c
index c67a5f0..829bd0e 100644
--- a/src/anp.c
+++ b/src/anp.c
@@ -21,8 +21,8 @@ double eraAnp(double a)
    double w;
 
 
-   w = fmod(a, D2PI);
-   if (w < 0) w += D2PI;
+   w = fmod(a, ERFA_D2PI);
+   if (w < 0) w += ERFA_D2PI;
 
    return w;
 
diff --git a/src/anpm.c b/src/anpm.c
index 470c9c5..174c248 100644
--- a/src/anpm.c
+++ b/src/anpm.c
@@ -21,8 +21,8 @@ double eraAnpm(double a)
    double w;
 
 
-   w = fmod(a, D2PI);
-   if (fabs(w) >= DPI) w -= dsign(D2PI, a);
+   w = fmod(a, ERFA_D2PI);
+   if (fabs(w) >= ERFA_DPI) w -= ERFA_DSIGN(ERFA_D2PI, a);
 
    return w;
 
diff --git a/src/bi00.c b/src/bi00.c
index 3356a93..351cec3 100644
--- a/src/bi00.c
+++ b/src/bi00.c
@@ -46,11 +46,11 @@ void eraBi00(double *dpsibi, double *depsbi, double *dra)
 */
 {
 /* The frame bias corrections in longitude and obliquity */
-   const double DPBIAS = -0.041775  * DAS2R,
-                DEBIAS = -0.0068192 * DAS2R;
+   const double DPBIAS = -0.041775  * ERFA_DAS2R,
+                DEBIAS = -0.0068192 * ERFA_DAS2R;
 
 /* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */
-   const double DRA0 = -0.0146 * DAS2R;
+   const double DRA0 = -0.0146 * ERFA_DAS2R;
 
 
 /* Return the results (which are fixed). */
diff --git a/src/bp00.c b/src/bp00.c
index e8b61dc..3515cac 100644
--- a/src/bp00.c
+++ b/src/bp00.c
@@ -75,7 +75,7 @@ void eraBp00(double date1, double date2,
 */
 {
 /* J2000.0 obliquity (Lieske et al. 1977) */
-   const double EPS0 = 84381.448 * DAS2R;
+   const double EPS0 = 84381.448 * ERFA_DAS2R;
 
    double t, dpsibi, depsbi;
    double dra0, psia77, oma77, chia, dpsipr, depspr, psia, oma,
@@ -83,15 +83,15 @@ void eraBp00(double date1, double date2,
 
 
 /* Interval between fundamental epoch J2000.0 and current date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Frame bias. */
    eraBi00(&dpsibi, &depsbi, &dra0);
 
 /* Precession angles (Lieske et al. 1977) */
-   psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * DAS2R;
-   oma77  =       EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * DAS2R;
-   chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
+   psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * ERFA_DAS2R;
+   oma77  =       EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * ERFA_DAS2R;
+   chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * ERFA_DAS2R;
 
 /* Apply IAU 2000 precession corrections. */
    eraPr00(date1, date2, &dpsipr,  &depspr);
diff --git a/src/bp06.c b/src/bp06.c
index 9166af4..2a29f31 100644
--- a/src/bp06.c
+++ b/src/bp06.c
@@ -68,7 +68,7 @@ void eraBp06(double date1, double date2,
 
 
 /* B matrix. */
-   eraPfw06(DJM0, DJM00, &gamb, &phib, &psib, &epsa);
+   eraPfw06(ERFA_DJM0, ERFA_DJM00, &gamb, &phib, &psib, &epsa);
    eraFw2m(gamb, phib, psib, epsa, rb);
 
 /* PxB matrix. */
diff --git a/src/d2dtf.c b/src/d2dtf.c
index 7c3f312..43d671e 100644
--- a/src/d2dtf.c
+++ b/src/d2dtf.c
@@ -104,7 +104,7 @@ int eraD2dtf(const char *scale, int ndp, double d1, double d2,
 
    /* If leap second day, scale the fraction of a day into SI. */
       leap = fabs(ddt) > 0.5;
-      if (leap) fd += fd * ddt/DAYSEC;
+      if (leap) fd += fd * ddt/ERFA_DAYSEC;
    }
 
 /* Provisional time of day. */
diff --git a/src/d2tf.c b/src/d2tf.c
index ff6fccc..b5593b9 100644
--- a/src/d2tf.c
+++ b/src/d2tf.c
@@ -60,7 +60,7 @@ void eraD2tf(int ndp, double days, char *sign, int ihmsf[4])
    *sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
 
 /* Interval in seconds. */
-   a = DAYSEC * fabs(days);
+   a = ERFA_DAYSEC * fabs(days);
 
 /* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
    if (ndp < 0) {
@@ -70,7 +70,7 @@ void eraD2tf(int ndp, double days, char *sign, int ihmsf[4])
       }
       rs = (double) nrs;
       w = a / rs;
-      a = rs * dnint(w);
+      a = rs * ERFA_DNINT(w);
    }
 
 /* Express the unit of each field in resolution units. */
@@ -83,17 +83,17 @@ void eraD2tf(int ndp, double days, char *sign, int ihmsf[4])
    rh = rm * 60.0;
 
 /* Round the interval and express in resolution units. */
-   a = dnint(rs * a);
+   a = ERFA_DNINT(rs * a);
 
 /* Break into fields. */
    ah = a / rh;
-   ah = dint(ah);
+   ah = ERFA_DINT(ah);
    a -= ah * rh;
    am = a / rm;
-   am = dint(am);
+   am = ERFA_DINT(am);
    a -= am * rm;
    as = a / rs;
-   as = dint(as);
+   as = ERFA_DINT(as);
    af = a - as * rs;
 
 /* Return results. */
diff --git a/src/dtdb.c b/src/dtdb.c
index 2dc2109..b0bff7e 100644
--- a/src/dtdb.c
+++ b/src/dtdb.c
@@ -1063,14 +1063,14 @@ double eraDtdb(double date1, double date2,
 
 
 /* Time since J2000.0 in Julian millennia. */
-   t = ((date1 - DJ00) + date2) / DJM;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJM;
 
 /* ================= */
 /* Topocentric terms */
 /* ================= */
 
 /* Convert UT to local solar time in radians. */
-   tsol = fmod(ut, 1.0) * D2PI + elong;
+   tsol = fmod(ut, 1.0) * ERFA_D2PI + elong;
 
 /* FUNDAMENTAL ARGUMENTS:  Simon et al. 1994. */
 
@@ -1078,19 +1078,19 @@ double eraDtdb(double date1, double date2,
    w = t / 3600.0;
 
 /* Sun Mean Longitude. */
-   elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * DD2R;
+   elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * ERFA_DD2R;
 
 /* Sun Mean Anomaly. */
-   emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * DD2R;
+   emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * ERFA_DD2R;
 
 /* Mean Elongation of Moon from Sun. */
-   d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * DD2R;
+   d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * ERFA_DD2R;
 
 /* Mean Longitude of Jupiter. */
-   elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * DD2R;
+   elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * ERFA_DD2R;
 
 /* Mean Longitude of Saturn. */
-   els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * DD2R;
+   els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * ERFA_DD2R;
 
 /* TOPOCENTRIC TERMS:  Moyer 1981 and Murray 1983. */
    wt =   +  0.00029e-10 * u * sin(tsol + elsun - els)
diff --git a/src/dtf2d.c b/src/dtf2d.c
index 07748e1..1c3a11b 100644
--- a/src/dtf2d.c
+++ b/src/dtf2d.c
@@ -86,7 +86,7 @@ int eraDtf2d(const char *scale, int iy, int im, int id,
    dj += w;
 
 /* Day length and final minute length in seconds (provisional). */
-   day = DAYSEC;
+   day = ERFA_DAYSEC;
    seclim = 60;
 
 /* Deal with the UTC leap second case. */
diff --git a/src/eect00.c b/src/eect00.c
index b57c2c4..3f7e42a 100644
--- a/src/eect00.c
+++ b/src/eect00.c
@@ -174,7 +174,7 @@ double eraEect00(double date1, double date2)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental epoch J2000.0 and current date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Fundamental Arguments (from IERS Conventions 2003) */
 
@@ -222,7 +222,7 @@ double eraEect00(double date1, double date2)
       s1 += e1[i].s * sin(a) + e1[i].c * cos(a);
    }
 
-   eect = (s0 + s1 * t ) * DAS2R;
+   eect = (s0 + s1 * t ) * ERFA_DAS2R;
 
    return eect;
 
diff --git a/src/eform.c b/src/eform.c
index d59f046..dc4aa27 100644
--- a/src/eform.c
+++ b/src/eform.c
@@ -26,12 +26,12 @@ int eraEform ( int n, double *a, double *f )
 **
 **        n    ellipsoid
 **
-**        1     WGS84
-**        2     GRS80
-**        3     WGS72
+**        1     ERFA_WGS84
+**        2     ERFA_GRS80
+**        3     ERFA_WGS72
 **
 **     The n value has no significance outside the ERFA software.  For
-**     convenience, symbols WGS84 etc. are defined in erfam.h.
+**     convenience, symbols ERFA_WGS84 etc. are defined in erfam.h.
 **
 **  2) The ellipsoid parameters are returned in the form of equatorial
 **     radius in meters (a) and flattening (f).  The latter is a number
@@ -63,17 +63,17 @@ int eraEform ( int n, double *a, double *f )
 /* Look up a and f for the specified reference ellipsoid. */
    switch ( n ) {
 
-   case WGS84:
+   case ERFA_WGS84:
       *a = 6378137.0;
       *f = 1.0 / 298.257223563;
       break;
 
-   case GRS80:
+   case ERFA_GRS80:
       *a = 6378137.0;
       *f = 1.0 / 298.257222101;
       break;
 
-   case WGS72:
+   case ERFA_WGS72:
       *a = 6378135.0;
       *f = 1.0 / 298.26;
       break;
diff --git a/src/epb.c b/src/epb.c
index 8d5aff9..4f9aa3b 100644
--- a/src/epb.c
+++ b/src/epb.c
@@ -36,7 +36,7 @@ double eraEpb(double dj1, double dj2)
    double epb;
 
 
-   epb = 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
+   epb = 1900.0 + ((dj1 - ERFA_DJ00) + (dj2 + D1900)) / ERFA_DTY;
 
    return epb;
 
diff --git a/src/epb2jd.c b/src/epb2jd.c
index ac3e77e..11ee7ab 100644
--- a/src/epb2jd.c
+++ b/src/epb2jd.c
@@ -31,7 +31,7 @@ void eraEpb2jd(double epb, double *djm0, double *djm)
 */
 {
    *djm0 = 2400000.5;
-   *djm  =   15019.81352 + (epb - 1900.0) * DTY;
+   *djm  =   15019.81352 + (epb - 1900.0) * ERFA_DTY;
 
    return;
 
diff --git a/src/epj.c b/src/epj.c
index 5a67bfe..884b47e 100644
--- a/src/epj.c
+++ b/src/epj.c
@@ -33,7 +33,7 @@ double eraEpj(double dj1, double dj2)
    double epj;
 
 
-   epj = 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
+   epj = 2000.0 + ((dj1 - ERFA_DJ00) + dj2) / ERFA_DJY;
 
    return epj;
 
diff --git a/src/epv00.c b/src/epv00.c
index ea21568..94abe43 100644
--- a/src/epv00.c
+++ b/src/epv00.c
@@ -2388,7 +2388,7 @@ int eraEpv00(double date1, double date2,
 /*--------------------------------------------------------------------*/
 
 /* Time since reference epoch, Julian years. */
-   t = ((date1 - DJ00) + date2) / DJY;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJY;
    t2 = t*t;
 
 /* Set status. */
@@ -2447,7 +2447,7 @@ int eraEpv00(double date1, double date2,
 
    /* Heliocentric Earth position and velocity component. */
       ph[i] = xyz;
-      vh[i] = xyzd / DJY;
+      vh[i] = xyzd / ERFA_DJY;
 
    /* ------------------------------------------------ */
    /* Obtain component of SSB to Earth ecliptic vector */
@@ -2495,7 +2495,7 @@ int eraEpv00(double date1, double date2,
 
    /* Barycentric Earth position and velocity component. */
      pb[i] = xyz;
-     vb[i] = xyzd / DJY;
+     vb[i] = xyzd / ERFA_DJY;
 
    /* Next Cartesian component. */
    }
diff --git a/src/eqeq94.c b/src/eqeq94.c
index 2f4ae16..e4dff48 100644
--- a/src/eqeq94.c
+++ b/src/eqeq94.c
@@ -58,20 +58,20 @@ double eraEqeq94(double date1, double date2)
 
 
 /* Interval between fundamental epoch J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Longitude of the mean ascending node of the lunar orbit on the */
 /* ecliptic, measured from the mean equinox of date. */
    om = eraAnpm((450160.280 + (-482890.539
-           + (7.455 + 0.008 * t) * t) * t) * DAS2R
-           + fmod(-5.0 * t, 1.0) * D2PI);
+           + (7.455 + 0.008 * t) * t) * t) * ERFA_DAS2R
+           + fmod(-5.0 * t, 1.0) * ERFA_D2PI);
 
 /* Nutation components and mean obliquity. */
    eraNut80(date1, date2, &dpsi, &deps);
    eps0 = eraObl80(date1, date2);
 
 /* Equation of the equinoxes. */
-   ee = dpsi*cos(eps0) + DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om));
+   ee = dpsi*cos(eps0) + ERFA_DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om));
 
    return ee;
 
diff --git a/src/era00.c b/src/era00.c
index fb82bb7..501acc4 100644
--- a/src/era00.c
+++ b/src/era00.c
@@ -69,13 +69,13 @@ double eraEra00(double dj1, double dj2)
       d1 = dj2;
       d2 = dj1;
    }
-   t = d1 + (d2- DJ00);
+   t = d1 + (d2- ERFA_DJ00);
 
 /* Fractional part of T (days). */
    f = fmod(d1, 1.0) + fmod(d2, 1.0);
 
 /* Earth rotation angle at this UT1. */
-   theta = eraAnp(D2PI * (f + 0.7790572732640
+   theta = eraAnp(ERFA_D2PI * (f + 0.7790572732640
                             + 0.00273781191135448 * t));
 
    return theta;
diff --git a/src/erfam.h b/src/erfam.h
index 772a27f..d1d7376 100644
--- a/src/erfam.h
+++ b/src/erfam.h
@@ -16,85 +16,85 @@
 
 
 /* Pi */
-#define DPI (3.141592653589793238462643)
+#define ERFA_DPI (3.141592653589793238462643)
 
 /* 2Pi */
-#define D2PI (6.283185307179586476925287)
+#define ERFA_D2PI (6.283185307179586476925287)
 
 /* Degrees to radians */
-#define DD2R (1.745329251994329576923691e-2)
+#define ERFA_DD2R (1.745329251994329576923691e-2)
 
 /* Radians to arcseconds */
-#define DR2AS (206264.8062470963551564734)
+#define ERFA_DR2AS (206264.8062470963551564734)
 
 /* Arcseconds to radians */
-#define DAS2R (4.848136811095359935899141e-6)
+#define ERFA_DAS2R (4.848136811095359935899141e-6)
 
 /* Seconds of time to radians */
-#define DS2R (7.272205216643039903848712e-5)
+#define ERFA_DS2R (7.272205216643039903848712e-5)
 
 /* Arcseconds in a full circle */
-#define TURNAS (1296000.0)
+#define ERFA_TURNAS (1296000.0)
 
 /* Milliarcseconds to radians */
-#define DMAS2R (DAS2R / 1e3)
+#define ERFA_DMAS2R (ERFA_DAS2R / 1e3)
 
 /* Length of tropical year B1900 (days) */
-#define DTY (365.242198781)
+#define ERFA_DTY (365.242198781)
 
 /* Seconds per day. */
-#define DAYSEC (86400.0)
+#define ERFA_DAYSEC (86400.0)
 
 /* Days per Julian year */
-#define DJY (365.25)
+#define ERFA_DJY (365.25)
 
 /* Days per Julian century */
-#define DJC (36525.0)
+#define ERFA_DJC (36525.0)
 
 /* Days per Julian millennium */
-#define DJM (365250.0)
+#define ERFA_DJM (365250.0)
 
 /* Reference epoch (J2000.0), Julian Date */
-#define DJ00 (2451545.0)
+#define ERFA_DJ00 (2451545.0)
 
 /* Julian Date of Modified Julian Date zero */
-#define DJM0 (2400000.5)
+#define ERFA_DJM0 (2400000.5)
 
 /* Reference epoch (J2000.0), Modified Julian Date */
-#define DJM00 (51544.5)
+#define ERFA_DJM00 (51544.5)
 
 /* 1977 Jan 1.0 as MJD */
-#define DJM77 (43144.0)
+#define ERFA_DJM77 (43144.0)
 
 /* TT minus TAI (s) */
-#define TTMTAI (32.184)
+#define ERFA_TTMTAI (32.184)
 
 /* AU (m) */
-#define DAU (149597870e3)
+#define ERFA_DAU (149597870e3)
 
 /* Speed of light (AU per day) */
-#define DC (DAYSEC / 499.004782)
+#define ERFA_DC (ERFA_DAYSEC / 499.004782)
 
 /* L_G = 1 - d(TT)/d(TCG) */
-#define ELG (6.969290134e-10)
+#define ERFA_ELG (6.969290134e-10)
 
 /* L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0 */
-#define ELB (1.550519768e-8)
-#define TDB0 (-6.55e-5)
+#define ERFA_ELB (1.550519768e-8)
+#define ERFA_TDB0 (-6.55e-5)
 
-/* dint(A) - truncate to nearest whole number towards zero (double) */
-#define dint(A) ((A)<0.0?ceil(A):floor(A))
+/* ERFA_DINT(A) - truncate to nearest whole number towards zero (double) */
+#define ERFA_DINT(A) ((A)<0.0?ceil(A):floor(A))
 
-/* dnint(A) - round to nearest whole number (double) */
-#define dnint(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5))
+/* ERFA_DNINT(A) - round to nearest whole number (double) */
+#define ERFA_DNINT(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5))
 
-/* dsign(A,B) - magnitude of A with sign of B (double) */
-#define dsign(A,B) ((B)<0.0?-fabs(A):fabs(A))
+/* ERFA_DSIGN(A,B) - magnitude of A with sign of B (double) */
+#define ERFA_DSIGN(A,B) ((B)<0.0?-fabs(A):fabs(A))
 
 /* Reference ellipsoids */
-#define WGS84 1
-#define GRS80 2
-#define WGS72 3
+#define ERFA_WGS84 1
+#define ERFA_GRS80 2
+#define ERFA_WGS72 3
 
 #endif
 
diff --git a/src/fad03.c b/src/fad03.c
index 47c8219..50890ed 100644
--- a/src/fad03.c
+++ b/src/fad03.c
@@ -43,7 +43,7 @@ double eraFad03(double t)
              t * ( 1602961601.2090 +
              t * (        - 6.3706 +
              t * (          0.006593 +
-             t * (        - 0.00003169 ) ) ) ), TURNAS ) * DAS2R;
+             t * (        - 0.00003169 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R;
 
    return a;
 
diff --git a/src/fae03.c b/src/fae03.c
index 32d598f..e2002d4 100644
--- a/src/fae03.c
+++ b/src/fae03.c
@@ -42,7 +42,7 @@ double eraFae03(double t)
 
 
 /* Mean longitude of Earth (IERS Conventions 2003). */
-   a = fmod(1.753470314 + 628.3075849991 * t, D2PI);
+   a = fmod(1.753470314 + 628.3075849991 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/faf03.c b/src/faf03.c
index fb8b97d..bb3bd8d 100644
--- a/src/faf03.c
+++ b/src/faf03.c
@@ -45,7 +45,7 @@ double eraFaf03(double t)
              t * ( 1739527262.8478 +
              t * (       - 12.7512 +
              t * (        - 0.001037 +
-             t * (          0.00000417 ) ) ) ), TURNAS ) * DAS2R;
+             t * (          0.00000417 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R;
 
    return a;
 
diff --git a/src/faju03.c b/src/faju03.c
index efc2f87..a330786 100644
--- a/src/faju03.c
+++ b/src/faju03.c
@@ -42,7 +42,7 @@ double eraFaju03(double t)
 
 
 /* Mean longitude of Jupiter (IERS Conventions 2003). */
-   a = fmod(0.599546497 + 52.9690962641 * t, D2PI);
+   a = fmod(0.599546497 + 52.9690962641 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/fal03.c b/src/fal03.c
index 3b886b6..e0d7c9b 100644
--- a/src/fal03.c
+++ b/src/fal03.c
@@ -43,7 +43,7 @@ double eraFal03(double t)
              t * ( 1717915923.2178 +
              t * (         31.8792 +
              t * (          0.051635 +
-             t * (        - 0.00024470 ) ) ) ), TURNAS ) * DAS2R;
+             t * (        - 0.00024470 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R;
 
    return a;
 
diff --git a/src/falp03.c b/src/falp03.c
index bd61eb3..06a01bf 100644
--- a/src/falp03.c
+++ b/src/falp03.c
@@ -43,7 +43,7 @@ double eraFalp03(double t)
              t * ( 129596581.0481 +
              t * (       - 0.5532 +
              t * (         0.000136 +
-             t * (       - 0.00001149 ) ) ) ), TURNAS ) * DAS2R;
+             t * (       - 0.00001149 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R;
 
    return a;
 
diff --git a/src/fama03.c b/src/fama03.c
index 688a1fb..7f90eb0 100644
--- a/src/fama03.c
+++ b/src/fama03.c
@@ -42,7 +42,7 @@ double eraFama03(double t)
 
 
 /* Mean longitude of Mars (IERS Conventions 2003). */
-   a = fmod(6.203480913 + 334.0612426700 * t, D2PI);
+   a = fmod(6.203480913 + 334.0612426700 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/fame03.c b/src/fame03.c
index e52be91..10b34f8 100644
--- a/src/fame03.c
+++ b/src/fame03.c
@@ -42,7 +42,7 @@ double eraFame03(double t)
 
 
 /* Mean longitude of Mercury (IERS Conventions 2003). */
-   a = fmod(4.402608842 + 2608.7903141574 * t, D2PI);
+   a = fmod(4.402608842 + 2608.7903141574 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/fane03.c b/src/fane03.c
index b6e98cb..c7e3887 100644
--- a/src/fane03.c
+++ b/src/fane03.c
@@ -39,7 +39,7 @@ double eraFane03(double t)
 
 
 /* Mean longitude of Neptune (IERS Conventions 2003). */
-   a = fmod(5.311886287 + 3.8133035638 * t, D2PI);
+   a = fmod(5.311886287 + 3.8133035638 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/faom03.c b/src/faom03.c
index bd2c4ee..6d7bade 100644
--- a/src/faom03.c
+++ b/src/faom03.c
@@ -44,7 +44,7 @@ double eraFaom03(double t)
              t * ( - 6962890.5431 +
              t * (         7.4722 +
              t * (         0.007702 +
-             t * (       - 0.00005939 ) ) ) ), TURNAS ) * DAS2R;
+             t * (       - 0.00005939 ) ) ) ), ERFA_TURNAS ) * ERFA_DAS2R;
 
    return a;
 
diff --git a/src/fasa03.c b/src/fasa03.c
index 57fa503..3528f97 100644
--- a/src/fasa03.c
+++ b/src/fasa03.c
@@ -42,7 +42,7 @@ double eraFasa03(double t)
 
 
 /* Mean longitude of Saturn (IERS Conventions 2003). */
-   a = fmod(0.874016757 + 21.3299104960 * t, D2PI);
+   a = fmod(0.874016757 + 21.3299104960 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/faur03.c b/src/faur03.c
index 71972c5..c0e70c1 100644
--- a/src/faur03.c
+++ b/src/faur03.c
@@ -39,7 +39,7 @@ double eraFaur03(double t)
 
 
 /* Mean longitude of Uranus (IERS Conventions 2003). */
-   a = fmod(5.481293872 + 7.4781598567 * t, D2PI);
+   a = fmod(5.481293872 + 7.4781598567 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/fave03.c b/src/fave03.c
index 4101171..aee5658 100644
--- a/src/fave03.c
+++ b/src/fave03.c
@@ -42,7 +42,7 @@ double eraFave03(double t)
 
 
 /* Mean longitude of Venus (IERS Conventions 2003). */
-   a = fmod(3.176146697 + 1021.3285546211 * t, D2PI);
+   a = fmod(3.176146697 + 1021.3285546211 * t, ERFA_D2PI);
 
    return a;
 
diff --git a/src/fk5hip.c b/src/fk5hip.c
index e26303e..ff1878a 100644
--- a/src/fk5hip.c
+++ b/src/fk5hip.c
@@ -47,13 +47,13 @@ void eraFk5hip(double r5h[3][3], double s5h[3])
    double omx, omy, omz;
 
 
-   epx = -19.9e-3 * DAS2R;
-   epy =  -9.1e-3 * DAS2R;
-   epz =  22.9e-3 * DAS2R;
+   epx = -19.9e-3 * ERFA_DAS2R;
+   epy =  -9.1e-3 * ERFA_DAS2R;
+   epz =  22.9e-3 * ERFA_DAS2R;
 
-   omx = -0.30e-3 * DAS2R;
-   omy =  0.60e-3 * DAS2R;
-   omz =  0.70e-3 * DAS2R;
+   omx = -0.30e-3 * ERFA_DAS2R;
+   omy =  0.60e-3 * ERFA_DAS2R;
+   omz =  0.70e-3 * ERFA_DAS2R;
 
 /* FK5 to Hipparcos orientation expressed as an r-vector. */
    v[0] = epx;
diff --git a/src/fk5hz.c b/src/fk5hz.c
index f9e5140..56d08cc 100644
--- a/src/fk5hz.c
+++ b/src/fk5hz.c
@@ -78,7 +78,7 @@ void eraFk5hz(double r5, double d5, double date1, double date2,
 
 
 /* Interval from given date to fundamental epoch J2000.0 (JY). */
-   t = - ((date1 - DJ00) + date2) / DJY;
+   t = - ((date1 - ERFA_DJ00) + date2) / ERFA_DJY;
 
 /* FK5 barycentric position vector. */
    eraS2c(r5, d5, p5e);
diff --git a/src/gc2gd.c b/src/gc2gd.c
index 8173e2e..1faa09b 100644
--- a/src/gc2gd.c
+++ b/src/gc2gd.c
@@ -31,12 +31,12 @@ int eraGc2gd ( int n, double xyz[3],
 **
 **        n    ellipsoid
 **
-**        1     WGS84
-**        2     GRS80
-**        3     WGS72
+**        1     ERFA_WGS84
+**        2     ERFA_GRS80
+**        3     ERFA_WGS72
 **
 **     The n value has no significance outside the ERFA software.  For
-**     convenience, symbols WGS84 etc. are defined in erfam.h.
+**     convenience, symbols ERFA_WGS84 etc. are defined in erfam.h.
 **
 **  2) The geocentric vector (xyz, given) and height (height, returned)
 **     are in meters.
diff --git a/src/gc2gde.c b/src/gc2gde.c
index e9aa746..84ddec4 100644
--- a/src/gc2gde.c
+++ b/src/gc2gde.c
@@ -46,7 +46,7 @@ int eraGc2gde ( double a, double f, double xyz[3],
 **  6) The inverse transformation is performed in the function
 **     eraGd2gce.
 **
-**  7) The transformation for a standard ellipsoid (such as WGS84) can
+**  7) The transformation for a standard ellipsoid (such as ERFA_WGS84) can
 **     more conveniently be performed by calling eraGc2gd, which uses a
 **     numerical code to identify the required A and F values.
 **
@@ -133,7 +133,7 @@ int eraGc2gde ( double a, double f, double xyz[3],
    } else {
 
    /* Exception: pole. */
-      *phi = DPI / 2.0;
+      *phi = ERFA_DPI / 2.0;
       *height = absz - b;
    }
 
diff --git a/src/gd2gc.c b/src/gd2gc.c
index cf6a2ba..0c4f80b 100644
--- a/src/gd2gc.c
+++ b/src/gd2gc.c
@@ -31,12 +31,12 @@ int eraGd2gc ( int n, double elong, double phi, double height,
 **
 **        n    ellipsoid
 **
-**        1     WGS84
-**        2     GRS80
-**        3     WGS72
+**        1     ERFA_WGS84
+**        2     ERFA_GRS80
+**        3     ERFA_WGS72
 **
 **     The n value has no significance outside the ERFA software.  For
-**     convenience, symbols WGS84 etc. are defined in erfam.h.
+**     convenience, symbols ERFA_WGS84 etc. are defined in erfam.h.
 **
 **  2) The height (height, given) and the geocentric vector (xyz,
 **     returned) are in meters.
diff --git a/src/gd2gce.c b/src/gd2gce.c
index e45c0b4..f5a4e33 100644
--- a/src/gd2gce.c
+++ b/src/gd2gce.c
@@ -42,7 +42,7 @@ int eraGd2gce ( double a, double f, double elong, double phi,
 **  5) The inverse transformation is performed in the function
 **     eraGc2gde.
 **
-**  6) The transformation for a standard ellipsoid (such as WGS84) can
+**  6) The transformation for a standard ellipsoid (such as ERFA_WGS84) can
 **     more conveniently be performed by calling eraGd2gc,  which uses a
 **     numerical code to identify the required a and f values.
 **
diff --git a/src/gmst00.c b/src/gmst00.c
index b56d054..446f50d 100644
--- a/src/gmst00.c
+++ b/src/gmst00.c
@@ -76,7 +76,7 @@ double eraGmst00(double uta, double utb, double tta, double ttb)
 
 
 /* TT Julian centuries since J2000.0. */
-   t = ((tta - DJ00) + ttb) / DJC;
+   t = ((tta - ERFA_DJ00) + ttb) / ERFA_DJC;
 
 /* Greenwich Mean Sidereal Time, IAU 2000. */
    gmst = eraAnp(eraEra00(uta, utb) +
@@ -85,7 +85,7 @@ double eraGmst00(double uta, double utb, double tta, double ttb)
                    (     1.39667721 +
                    (    -0.00009344 +
                    (     0.00001882 )
-          * t) * t) * t) * t) * DAS2R);
+          * t) * t) * t) * t) * ERFA_DAS2R);
 
    return gmst;
 
diff --git a/src/gmst06.c b/src/gmst06.c
index d322905..3a58262 100644
--- a/src/gmst06.c
+++ b/src/gmst06.c
@@ -66,7 +66,7 @@ double eraGmst06(double uta, double utb, double tta, double ttb)
 
 
 /* TT Julian centuries since J2000.0. */
-   t = ((tta - DJ00) + ttb) / DJC;
+   t = ((tta - ERFA_DJ00) + ttb) / ERFA_DJC;
 
 /* Greenwich mean sidereal time, IAU 2006. */
    gmst = eraAnp(eraEra00(uta, utb) +
@@ -76,7 +76,7 @@ double eraGmst06(double uta, double utb, double tta, double ttb)
                   (    -0.00000044  +
                   (    -0.000029956 +
                   (    -0.0000000368 )
-          * t) * t) * t) * t) * t) * DAS2R);
+          * t) * t) * t) * t) * t) * ERFA_DAS2R);
 
    return gmst;
 
diff --git a/src/gmst82.c b/src/gmst82.c
index 568394d..7cfefee 100644
--- a/src/gmst82.c
+++ b/src/gmst82.c
@@ -65,7 +65,7 @@ double eraGmst82(double dj1, double dj2)
 */
 {
 /* Coefficients of IAU 1982 GMST-UT1 model */
-   double A = 24110.54841  -  DAYSEC / 2.0;
+   double A = 24110.54841  -  ERFA_DAYSEC / 2.0;
    double B = 8640184.812866;
    double C = 0.093104;
    double D =  -6.2e-6;
@@ -85,13 +85,13 @@ double eraGmst82(double dj1, double dj2)
       d1 = dj2;
       d2 = dj1;
    }
-   t = (d1 + (d2 - DJ00)) / DJC;
+   t = (d1 + (d2 - ERFA_DJ00)) / ERFA_DJC;
 
 /* Fractional part of JD(UT1), in seconds. */
-   f = DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
+   f = ERFA_DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
 
 /* GMST at this UT1. */
-   gmst = eraAnp(DS2R * ((A + (B + (C + D * t) * t) * t) + f));
+   gmst = eraAnp(ERFA_DS2R * ((A + (B + (C + D * t) * t) * t) + f));
 
    return gmst;
 
diff --git a/src/hfk5z.c b/src/hfk5z.c
index ac681b4..4476564 100644
--- a/src/hfk5z.c
+++ b/src/hfk5z.c
@@ -84,7 +84,7 @@ void eraHfk5z(double rh, double dh, double date1, double date2,
 
 
 /* Time interval from fundamental epoch J2000.0 to given date (JY). */
-   t = ((date1 - DJ00) + date2) / DJY;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJY;
 
 /* Hipparcos barycentric position vector (normalized). */
    eraS2c(rh, dh, ph);
diff --git a/src/nut00a.c b/src/nut00a.c
index 0d45b40..5345c53 100644
--- a/src/nut00a.c
+++ b/src/nut00a.c
@@ -159,7 +159,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
           dpsipl, depspl;
 
 /* Units of 0.1 microarcsecond to radians */
-   const double U2R = DAS2R / 1e7;
+   const double U2R = ERFA_DAS2R / 1e7;
 
 /* ------------------------- */
 /* Luni-Solar nutation model */
@@ -1851,7 +1851,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental date J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* ------------------- */
 /* LUNI-SOLAR NUTATION */
@@ -1867,7 +1867,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
             t * (129596581.0481  +
             t * (-0.5532  +
             t * (0.000136  +
-            t * (-0.00001149)))), TURNAS) * DAS2R;
+            t * (-0.00001149)))), ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Mean longitude of the Moon minus that of the ascending node */
 /* (IERS 2003. */
@@ -1878,7 +1878,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
           t * (1602961601.2090  +
           t * (-6.3706  +
           t * (0.006593  +
-          t * (-0.00003169)))), TURNAS) * DAS2R;
+          t * (-0.00003169)))), ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Mean longitude of the ascending node of the Moon (IERS 2003). */
    om = eraFaom03(t);
@@ -1895,7 +1895,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
                  (double)xls[i].nlp * elp +
                  (double)xls[i].nf  * f +
                  (double)xls[i].nd  * d +
-                 (double)xls[i].nom * om, D2PI);
+                 (double)xls[i].nom * om, ERFA_D2PI);
       sarg = sin(arg);
       carg = cos(arg);
 
@@ -1920,17 +1920,17 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
 /* 0.1 microarcsecond. */
 
 /* Mean anomaly of the Moon (MHB2000). */
-   al = fmod(2.35555598 + 8328.6914269554 * t, D2PI);
+   al = fmod(2.35555598 + 8328.6914269554 * t, ERFA_D2PI);
 
 /* Mean longitude of the Moon minus that of the ascending node */
 /*(MHB2000). */
-   af = fmod(1.627905234 + 8433.466158131 * t, D2PI);
+   af = fmod(1.627905234 + 8433.466158131 * t, ERFA_D2PI);
 
 /* Mean elongation of the Moon from the Sun (MHB2000). */
-   ad = fmod(5.198466741 + 7771.3771468121 * t, D2PI);
+   ad = fmod(5.198466741 + 7771.3771468121 * t, ERFA_D2PI);
 
 /* Mean longitude of the ascending node of the Moon (MHB2000). */
-   aom = fmod(2.18243920 - 33.757045 * t, D2PI);
+   aom = fmod(2.18243920 - 33.757045 * t, ERFA_D2PI);
 
 /* General accumulated precession in longitude (IERS 2003). */
    apa = eraFapa03(t);
@@ -1945,7 +1945,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
    alur = eraFaur03(t);
 
 /* Neptune longitude (MHB2000). */
-   alne = fmod(5.321159000 + 3.8127774000 * t, D2PI);
+   alne = fmod(5.321159000 + 3.8127774000 * t, ERFA_D2PI);
 
 /* Initialize the nutation values. */
    dp = 0.0;
@@ -1967,7 +1967,7 @@ void eraNut00a(double date1, double date2, double *dpsi, double *deps)
                  (double)xpl[i].nsa * alsa +
                  (double)xpl[i].nur * alur +
                  (double)xpl[i].nne * alne +
-                 (double)xpl[i].npa * apa, D2PI);
+                 (double)xpl[i].npa * apa, ERFA_D2PI);
       sarg = sin(arg);
       carg = cos(arg);
 
diff --git a/src/nut00b.c b/src/nut00b.c
index cc36b42..8fd5cad 100644
--- a/src/nut00b.c
+++ b/src/nut00b.c
@@ -125,14 +125,14 @@ void eraNut00b(double date1, double date2, double *dpsi, double *deps)
    int i;
 
 /* Units of 0.1 microarcsecond to radians */
-   static const double U2R = DAS2R / 1e7;
+   static const double U2R = ERFA_DAS2R / 1e7;
 
 /* ---------------------------------------- */
 /* Fixed offsets in lieu of planetary terms */
 /* ---------------------------------------- */
 
-   static const double DPPLAN = -0.135 * DMAS2R;
-   static const double DEPLAN =  0.388 * DMAS2R;
+   static const double DPPLAN = -0.135 * ERFA_DMAS2R;
+   static const double DEPLAN =  0.388 * ERFA_DMAS2R;
 
 /* --------------------------------------------------- */
 /* Luni-solar nutation: argument and term coefficients */
@@ -250,7 +250,7 @@ void eraNut00b(double date1, double date2, double *dpsi, double *deps)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental epoch J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* --------------------*/
 /* LUNI-SOLAR NUTATION */
@@ -259,19 +259,19 @@ void eraNut00b(double date1, double date2, double *dpsi, double *deps)
 /* Fundamental (Delaunay) arguments from Simon et al. (1994) */
 
 /* Mean anomaly of the Moon. */
-   el = fmod(485868.249036 + (1717915923.2178) * t, TURNAS) * DAS2R;
+   el = fmod(485868.249036 + (1717915923.2178) * t, ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Mean anomaly of the Sun. */
-   elp = fmod(1287104.79305 + (129596581.0481) * t, TURNAS) * DAS2R;
+   elp = fmod(1287104.79305 + (129596581.0481) * t, ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Mean argument of the latitude of the Moon. */
-   f = fmod(335779.526232 + (1739527262.8478) * t, TURNAS) * DAS2R;
+   f = fmod(335779.526232 + (1739527262.8478) * t, ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Mean elongation of the Moon from the Sun. */
-   d = fmod(1072260.70369 + (1602961601.2090) * t, TURNAS) * DAS2R;
+   d = fmod(1072260.70369 + (1602961601.2090) * t, ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Mean longitude of the ascending node of the Moon. */
-   om = fmod(450160.398036 + (-6962890.5431) * t, TURNAS) * DAS2R;
+   om = fmod(450160.398036 + (-6962890.5431) * t, ERFA_TURNAS) * ERFA_DAS2R;
 
 /* Initialize the nutation values. */
    dp = 0.0;
@@ -285,7 +285,7 @@ void eraNut00b(double date1, double date2, double *dpsi, double *deps)
                   (double)x[i].nlp * elp +
                   (double)x[i].nf  * f   +
                   (double)x[i].nd  * d   +
-                  (double)x[i].nom * om, D2PI  );
+                  (double)x[i].nom * om, ERFA_D2PI  );
       sarg = sin(arg);
       carg = cos(arg);
 
diff --git a/src/nut06a.c b/src/nut06a.c
index c541f35..670248e 100644
--- a/src/nut06a.c
+++ b/src/nut06a.c
@@ -83,7 +83,7 @@ void eraNut06a(double date1, double date2, double *dpsi, double *deps)
 
 
 /* Interval between fundamental date J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Factor correcting for secular variation of J2. */
    fj2 = -2.7774e-6 * t;
diff --git a/src/nut80.c b/src/nut80.c
index eba9c7e..408dabe 100644
--- a/src/nut80.c
+++ b/src/nut80.c
@@ -56,7 +56,7 @@ void eraNut80(double date1, double date2, double *dpsi, double *deps)
    int j;
 
 /* Units of 0.1 milliarcsecond to radians */
-   const double U2R = DAS2R / 1e4;
+   const double U2R = ERFA_DAS2R / 1e4;
 
 /* ------------------------------------------------ */
 /* Table of multiples of arguments and coefficients */
@@ -206,7 +206,7 @@ void eraNut80(double date1, double date2, double *dpsi, double *deps)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental epoch J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* --------------------- */
 /* Fundamental arguments */
@@ -215,28 +215,28 @@ void eraNut80(double date1, double date2, double *dpsi, double *deps)
 /* Mean longitude of Moon minus mean longitude of Moon's perigee. */
    el = eraAnpm(
         (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t)
-        * DAS2R + fmod(1325.0 * t, 1.0) * D2PI);
+        * ERFA_DAS2R + fmod(1325.0 * t, 1.0) * ERFA_D2PI);
 
 /* Mean longitude of Sun minus mean longitude of Sun's perigee. */
    elp = eraAnpm(
          (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t)
-         * DAS2R + fmod(99.0 * t, 1.0) * D2PI);
+         * ERFA_DAS2R + fmod(99.0 * t, 1.0) * ERFA_D2PI);
 
 /* Mean longitude of Moon minus mean longitude of Moon's node. */
    f = eraAnpm(
        (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t)
-       * DAS2R + fmod(1342.0 * t, 1.0) * D2PI);
+       * ERFA_DAS2R + fmod(1342.0 * t, 1.0) * ERFA_D2PI);
 
 /* Mean elongation of Moon from Sun. */
    d = eraAnpm(
        (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t)
-       * DAS2R + fmod(1236.0 * t, 1.0) * D2PI);
+       * ERFA_DAS2R + fmod(1236.0 * t, 1.0) * ERFA_D2PI);
 
 /* Longitude of the mean ascending node of the lunar orbit on the */
 /* ecliptic, measured from the mean equinox of date. */
    om = eraAnpm(
         (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t)
-        * DAS2R + fmod(-5.0 * t, 1.0) * D2PI);
+        * ERFA_DAS2R + fmod(-5.0 * t, 1.0) * ERFA_D2PI);
 
 /* --------------- */
 /* Nutation series */
diff --git a/src/obl06.c b/src/obl06.c
index 2267cbc..eadc2e0 100644
--- a/src/obl06.c
+++ b/src/obl06.c
@@ -50,7 +50,7 @@ double eraObl06(double date1, double date2)
 
 
 /* Interval between fundamental date J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Mean obliquity. */
    eps0 = (84381.406     +
@@ -58,7 +58,7 @@ double eraObl06(double date1, double date2)
           ( -0.0001831   +
           (  0.00200340  +
           ( -0.000000576 +
-          ( -0.0000000434) * t) * t) * t) * t) * t) * DAS2R;
+          ( -0.0000000434) * t) * t) * t) * t) * t) * ERFA_DAS2R;
 
    return eps0;
 
diff --git a/src/obl80.c b/src/obl80.c
index 43164f8..8c5924a 100644
--- a/src/obl80.c
+++ b/src/obl80.c
@@ -52,10 +52,10 @@ double eraObl80(double date1, double date2)
 
 
 /* Interval between fundamental epoch J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Mean obliquity of date. */
-   eps0 = DAS2R * (84381.448  +
+   eps0 = ERFA_DAS2R * (84381.448  +
                   (-46.8150   +
                   (-0.00059   +
                   ( 0.001813) * t) * t) * t);
diff --git a/src/p06e.c b/src/p06e.c
index 2d5ce55..64153c7 100644
--- a/src/p06e.c
+++ b/src/p06e.c
@@ -128,11 +128,11 @@ void eraP06e(double date1, double date2,
 
 
 /* Interval between fundamental date J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Obliquity at J2000.0. */
 
-   *eps0 = 84381.406 * DAS2R;
+   *eps0 = 84381.406 * ERFA_DAS2R;
 
 /* Luni-solar precession. */
 
@@ -141,7 +141,7 @@ void eraP06e(double date1, double date2,
            (   -0.00114045   +
            (    0.000132851  +
            (   -0.0000000951 )
-           * t) * t) * t) * t) * t * DAS2R;
+           * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Inclination of mean equator with respect to the J2000.0 ecliptic. */
 
@@ -150,7 +150,7 @@ void eraP06e(double date1, double date2,
                   ( -0.00772503   +
                   ( -0.000000467  +
                   (  0.0000003337 )
-                  * t) * t) * t) * t) * t * DAS2R;
+                  * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Ecliptic pole x, J2000.0 ecliptic triad. */
 
@@ -159,7 +159,7 @@ void eraP06e(double date1, double date2,
           ( -0.00022466   +
           ( -0.000000912  +
           (  0.0000000120 )
-          * t) * t) * t) * t) * t * DAS2R;
+          * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Ecliptic pole -y, J2000.0 ecliptic triad. */
 
@@ -168,7 +168,7 @@ void eraP06e(double date1, double date2,
           (   0.00052413   +
           (  -0.000000646  +
           (  -0.0000000172 )
-          * t) * t) * t) * t) * t * DAS2R;
+          * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Angle between moving and J2000.0 ecliptics. */
 
@@ -177,7 +177,7 @@ void eraP06e(double date1, double date2,
           ( -0.00012559   +
           (  0.000000113  +
           ( -0.0000000022 )
-          * t) * t) * t) * t) * t * DAS2R;
+          * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Longitude of ascending node of the moving ecliptic. */
 
@@ -187,7 +187,7 @@ void eraP06e(double date1, double date2,
            (     -0.0005371   +
            (     -0.00004797  +
            (      0.000000072 )
-           * t) * t) * t) * t) * t) * DAS2R;
+           * t) * t) * t) * t) * t) * ERFA_DAS2R;
 
 /* Mean obliquity of the ecliptic. */
 
@@ -200,7 +200,7 @@ void eraP06e(double date1, double date2,
            ( -0.00121197   +
            (  0.000170663  +
            ( -0.0000000560 )
-           * t) * t) * t) * t) * t * DAS2R;
+           * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Equatorial precession: minus the third of the 323 Euler angles. */
 
@@ -210,7 +210,7 @@ void eraP06e(double date1, double date2,
          (    0.01826837   +
          (   -0.000028596  +
          (   -0.0000002904 )
-         * t) * t) * t) * t) * t) * DAS2R;
+         * t) * t) * t) * t) * t) * ERFA_DAS2R;
 
 /* Equatorial precession: minus the first of the 323 Euler angles. */
 
@@ -220,7 +220,7 @@ void eraP06e(double date1, double date2,
             (    0.01801828   +
             (   -0.000005971  +
             (   -0.0000003173 )
-            * t) * t) * t) * t) * t) * DAS2R;
+            * t) * t) * t) * t) * t) * ERFA_DAS2R;
 
 /* Equatorial precession: second of the 323 Euler angles. */
 
@@ -229,7 +229,7 @@ void eraP06e(double date1, double date2,
              (   -0.04182264   +
              (   -0.000007089  +
              (   -0.0000001274 )
-             * t) * t) * t) * t) * t * DAS2R;
+             * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* General precession. */
 
@@ -238,7 +238,7 @@ void eraP06e(double date1, double date2,
          (    0.00007964   +
          (   -0.000023857  +
          (    0.0000000383 )
-         * t) * t) * t) * t) * t * DAS2R;
+         * t) * t) * t) * t) * t * ERFA_DAS2R;
 
 /* Fukushima-Williams angles for precession. */
 
@@ -247,21 +247,21 @@ void eraP06e(double date1, double date2,
           ( -0.00031238   +
           ( -0.000002788  +
           (  0.0000000260 )
-          * t) * t) * t) * t) * t * DAS2R;
+          * t) * t) * t) * t) * t * ERFA_DAS2R;
 
    *phi = *eps0 + ( -46.811015     +
                   (   0.0511269    +
                   (   0.00053289   +
                   (  -0.000000440  +
                   (  -0.0000000176 )
-                  * t) * t) * t) * t) * t * DAS2R;
+                  * t) * t) * t) * t) * t * ERFA_DAS2R;
 
    *psi = ( 5038.481507     +
           (    1.5584176    +
           (   -0.00018522   +
           (   -0.000026452  +
           (   -0.0000000148 )
-          * t) * t) * t) * t) * t * DAS2R;
+          * t) * t) * t) * t) * t * ERFA_DAS2R;
 
    return;
 
diff --git a/src/pb06.c b/src/pb06.c
index a3c3b3b..fa8c761 100644
--- a/src/pb06.c
+++ b/src/pb06.c
@@ -83,7 +83,7 @@ void eraPb06(double date1, double date2,
    *bzeta = atan2 (r[1][0], r[1][1]);
    r31 = r[2][0];
    r32 = r[2][1];
-   *btheta = atan2(-dsign(sqrt(r31 * r31 + r32 * r32), r[0][2]),
+   *btheta = atan2(-ERFA_DSIGN(sqrt(r31 * r31 + r32 * r32), r[0][2]),
                    r[2][2]);
 
    return;
diff --git a/src/pfw06.c b/src/pfw06.c
index a5398a4..6fa479b 100644
--- a/src/pfw06.c
+++ b/src/pfw06.c
@@ -81,7 +81,7 @@ void eraPfw06(double date1, double date2,
 
 
 /* Interval between fundamental date J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* P03 bias+precession angles. */
    *gamb = (    -0.052928     +
@@ -90,21 +90,21 @@ void eraPfw06(double date1, double date2,
            (    -0.00031238   +
            (    -0.000002788  +
            (     0.0000000260 )
-           * t) * t) * t) * t) * t) * DAS2R;
+           * t) * t) * t) * t) * t) * ERFA_DAS2R;
    *phib = ( 84381.412819     +
            (   -46.811016     +
            (     0.0511268    +
            (     0.00053289   +
            (    -0.000000440  +
            (    -0.0000000176 )
-           * t) * t) * t) * t) * t) * DAS2R;
+           * t) * t) * t) * t) * t) * ERFA_DAS2R;
    *psib = (    -0.041775     +
            (  5038.481484     +
            (     1.5584175    +
            (    -0.00018522   +
            (    -0.000026452  +
            (    -0.0000000148 )
-           * t) * t) * t) * t) * t) * DAS2R;
+           * t) * t) * t) * t) * t) * ERFA_DAS2R;
    *epsa =  eraObl06(date1, date2);
 
    return;
diff --git a/src/plan94.c b/src/plan94.c
index 4025ef0..de91c8f 100644
--- a/src/plan94.c
+++ b/src/plan94.c
@@ -354,7 +354,7 @@ int eraPlan94(double date1, double date2, int np, double pv[2][3])
       np--;
 
    /* Time: Julian millennia since J2000.0. */
-      t = ((date1 - DJ00) + date2) / DJM;
+      t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJM;
 
    /* OK status unless remote date. */
       jstat = fabs(t) <= 1.0 ? 0 : 1;
@@ -365,19 +365,19 @@ int eraPlan94(double date1, double date2, int np, double pv[2][3])
            a[np][2] * t) * t;
       dl = (3600.0 * dlm[np][0] +
                     (dlm[np][1] +
-                     dlm[np][2] * t) * t) * DAS2R;
+                     dlm[np][2] * t) * t) * ERFA_DAS2R;
       de = e[np][0] +
          ( e[np][1] +
            e[np][2] * t) * t;
       dp = eraAnpm((3600.0 * pi[np][0] +
                             (pi[np][1] +
-                             pi[np][2] * t) * t) * DAS2R);
+                             pi[np][2] * t) * t) * ERFA_DAS2R);
       di = (3600.0 * dinc[np][0] +
                     (dinc[np][1] +
-                     dinc[np][2] * t) * t) * DAS2R;
+                     dinc[np][2] * t) * t) * ERFA_DAS2R;
       dom = eraAnpm((3600.0 * omega[np][0] +
                              (omega[np][1] +
-                              omega[np][2] * t) * t) * DAS2R);
+                              omega[np][2] * t) * t) * ERFA_DAS2R);
 
    /* Apply the trigonometric terms. */
       dmu = 0.35953620 * t;
@@ -397,7 +397,7 @@ int eraPlan94(double date1, double date2, int np, double pv[2][3])
          dl += t * (cl[np][k] * cos(argl) +
                     sl[np][k] * sin(argl)) * 1e-7;
       }
-      dl = fmod(dl, D2PI);
+      dl = fmod(dl, ERFA_D2PI);
 
    /* Iterative soln. of Kepler's equation to get eccentric anomaly. */
       am = dl - dp;
diff --git a/src/pmat76.c b/src/pmat76.c
index 959a728..84424c5 100644
--- a/src/pmat76.c
+++ b/src/pmat76.c
@@ -74,7 +74,7 @@ void eraPmat76(double date1, double date2, double rmatp[3][3])
 
 
 /* Precession Euler angles, J2000.0 to specified date. */
-   eraPrec76(DJ00, 0.0, date1, date2, &zeta, &z, &theta);
+   eraPrec76(ERFA_DJ00, 0.0, date1, date2, &zeta, &z, &theta);
 
 /* Form the rotation matrix. */
    eraIr(  wmat);
diff --git a/src/pn06.c b/src/pn06.c
index 9083aa8..114247e 100644
--- a/src/pn06.c
+++ b/src/pn06.c
@@ -101,7 +101,7 @@ void eraPn06(double date1, double date2, double dpsi, double deps,
 
 
 /* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */
-   eraPfw06(DJM0, DJM00, &gamb, &phib, &psib, &eps);
+   eraPfw06(ERFA_DJM0, ERFA_DJM00, &gamb, &phib, &psib, &eps);
 
 /* B matrix. */
    eraFw2m(gamb, phib, psib, eps, r1);
diff --git a/src/pr00.c b/src/pr00.c
index 67686be..a174f39 100644
--- a/src/pr00.c
+++ b/src/pr00.c
@@ -73,12 +73,12 @@ void eraPr00(double date1, double date2, double *dpsipr, double *depspr)
    double t;
 
 /* Precession and obliquity corrections (radians per century) */
-   static const double PRECOR = -0.29965 * DAS2R,
-                       OBLCOR = -0.02524 * DAS2R;
+   static const double PRECOR = -0.29965 * ERFA_DAS2R,
+                       OBLCOR = -0.02524 * ERFA_DAS2R;
 
 
 /* Interval between fundamental epoch J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Precession rate contributions with respect to IAU 1976/80. */
    *dpsipr = PRECOR * t;
diff --git a/src/prec76.c b/src/prec76.c
index 13f185b..d563bea 100644
--- a/src/prec76.c
+++ b/src/prec76.c
@@ -74,13 +74,13 @@ void eraPrec76(double ep01, double ep02, double ep11, double ep12,
 
 
 /* Interval between fundamental epoch J2000.0 and start epoch (JC). */
-   t0 = ((ep01 - DJ00) + ep02) / DJC;
+   t0 = ((ep01 - ERFA_DJ00) + ep02) / ERFA_DJC;
 
 /* Interval over which precession required (JC). */
-   t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
+   t = ((ep11 - ep01) + (ep12 - ep02)) / ERFA_DJC;
 
 /* Euler angles. */
-   tas2r = t * DAS2R;
+   tas2r = t * ERFA_DAS2R;
    w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0;
 
    *zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r;
diff --git a/src/pvstar.c b/src/pvstar.c
index 64ca9fe..509b96a 100644
--- a/src/pvstar.c
+++ b/src/pvstar.c
@@ -111,8 +111,8 @@ int eraPvstar(double pv[2][3], double *ra, double *dec,
    vt = eraPm(ut);
 
 /* Special-relativity dimensionless parameters. */
-   bett = vt / DC;
-   betr = vr / DC;
+   bett = vt / ERFA_DC;
+   betr = vr / ERFA_DC;
 
 /* The inertial-to-observed correction terms. */
    d = 1.0 + betr;
@@ -139,14 +139,14 @@ int eraPvstar(double pv[2][3], double *ra, double *dec,
    *ra = eraAnp(a);
 
 /* Return proper motions in radians per year. */
-   *pmr = rad * DJY;
-   *pmd = decd * DJY;
+   *pmr = rad * ERFA_DJY;
+   *pmd = decd * ERFA_DJY;
 
 /* Return parallax in arcsec. */
-   *px = DR2AS / r;
+   *px = ERFA_DR2AS / r;
 
 /* Return radial velocity in km/s. */
-   *rv = 1e-3 * rd * DAU / DAYSEC;
+   *rv = 1e-3 * rd * ERFA_DAU / ERFA_DAYSEC;
 
 /* OK status. */
    return 0;
diff --git a/src/s00.c b/src/s00.c
index 9c12a56..751e3c4 100644
--- a/src/s00.c
+++ b/src/s00.c
@@ -230,7 +230,7 @@ double eraS00(double date1, double date2, double x, double y)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental epoch J2000.0 and current date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Fundamental Arguments (from IERS Conventions 2003) */
 
@@ -311,7 +311,7 @@ double eraS00(double date1, double date2, double x, double y)
        (w2 +
        (w3 +
        (w4 +
-        w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
+        w5 * t) * t) * t) * t) * t) * ERFA_DAS2R - x*y/2.0;
 
    return s;
 
diff --git a/src/s06.c b/src/s06.c
index b5ac23a..7dcddb6 100644
--- a/src/s06.c
+++ b/src/s06.c
@@ -227,7 +227,7 @@ double eraS06(double date1, double date2, double x, double y)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental epoch J2000.0 and current date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Fundamental Arguments (from IERS Conventions 2003) */
 
@@ -308,7 +308,7 @@ double eraS06(double date1, double date2, double x, double y)
        (w2 +
        (w3 +
        (w4 +
-        w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
+        w5 * t) * t) * t) * t) * t) * ERFA_DAS2R - x*y/2.0;
 
    return s;
 
diff --git a/src/sp00.c b/src/sp00.c
index 57690b0..fd56652 100644
--- a/src/sp00.c
+++ b/src/sp00.c
@@ -55,10 +55,10 @@ double eraSp00(double date1, double date2)
 
 
 /* Interval between fundamental epoch J2000.0 and current date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Approximate s'. */
-   sp = -47e-6 * t * DAS2R;
+   sp = -47e-6 * t * ERFA_DAS2R;
 
    return sp;
 
diff --git a/src/starpm.c b/src/starpm.c
index d57659a..bbdbd43 100644
--- a/src/starpm.c
+++ b/src/starpm.c
@@ -119,7 +119,7 @@ int eraStarpm(double ra1, double dec1,
    j1 = eraStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
 
 /* Light time when observed (days). */
-   tl1 = eraPm(pv1[0]) / DC;
+   tl1 = eraPm(pv1[0]) / ERFA_DC;
 
 /* Time interval, "before" to "after" (days). */
    dt = (ep2a - ep1a) + (ep2b - ep1b);
@@ -133,7 +133,7 @@ int eraStarpm(double ra1, double dec1,
    r2 = eraPdp(pv[0], pv[0]);
    rdv = eraPdp(pv[0], pv[1]);
    v2 = eraPdp(pv[1], pv[1]);
-   c2mv2 = DC*DC - v2;
+   c2mv2 = ERFA_DC*ERFA_DC - v2;
    if (c2mv2 <=  0) return -1;
    tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
 
diff --git a/src/starpv.c b/src/starpv.c
index f3aaaee..a48ae6e 100644
--- a/src/starpv.c
+++ b/src/starpv.c
@@ -143,21 +143,21 @@ int eraStarpv(double ra, double dec,
       w = PXMIN;
       iwarn = 1;
    }
-   r = DR2AS / w;
+   r = ERFA_DR2AS / w;
 
 /* Radial velocity (AU/day). */
-   rd = DAYSEC * rv * 1e3 / DAU;
+   rd = ERFA_DAYSEC * rv * 1e3 / ERFA_DAU;
 
 /* Proper motion (radian/day). */
-   rad = pmr / DJY;
-   decd = pmd / DJY;
+   rad = pmr / ERFA_DJY;
+   decd = pmd / ERFA_DJY;
 
 /* To pv-vector (AU,AU/day). */
    eraS2pv(ra, dec, r, rad, decd, rd, pv);
 
 /* If excessive velocity, arbitrarily set it to zero. */
    v = eraPm(pv[1]);
-   if (v / DC > VMAX) {
+   if (v / ERFA_DC > VMAX) {
       eraZp(pv[1]);
       iwarn += 2;
    }
@@ -172,8 +172,8 @@ int eraStarpv(double ra, double dec,
    vst = eraPm(ust);
 
 /* Special-relativity dimensionless parameters. */
-   betsr = vsr / DC;
-   betst = vst / DC;
+   betsr = vsr / ERFA_DC;
+   betst = vst / ERFA_DC;
 
 /* Determine the inertial-to-observed relativistic correction terms. */
    bett = betst;
diff --git a/src/t_erfa_c.c b/src/t_erfa_c.c
index f056eeb..00e932b 100644
--- a/src/t_erfa_c.c
+++ b/src/t_erfa_c.c
@@ -1601,19 +1601,19 @@ static void t_eform(int *status)
 
    viv(j, -1, "eraEform", "j0", status);
 
-   j = eraEform(WGS84, &a, &f);
+   j = eraEform(ERFA_WGS84, &a, &f);
 
    viv(j, 0, "eraEform", "j1", status);
    vvd(a, 6378137.0, 1e-10, "eraEform", "a1", status);
    vvd(f, 0.0033528106647474807, 1e-18, "eraEform", "f1", status);
 
-   j = eraEform(GRS80, &a, &f);
+   j = eraEform(ERFA_GRS80, &a, &f);
 
    viv(j, 0, "eraEform", "j2", status);
    vvd(a, 6378137.0, 1e-10, "eraEform", "a2", status);
    vvd(f, 0.0033528106811823189, 1e-18, "eraEform", "f2", status);
 
-   j = eraEform(WGS72, &a, &f);
+   j = eraEform(ERFA_WGS72, &a, &f);
 
    viv(j, 0, "eraEform", "j2", status);
    vvd(a, 6378135.0, 1e-10, "eraEform", "a3", status);
@@ -2402,21 +2402,21 @@ static void t_gc2gd(int *status)
 
    viv(j, -1, "eraGc2gd", "j0", status);
 
-   j = eraGc2gd(WGS84, xyz, &e, &p, &h);
+   j = eraGc2gd(ERFA_WGS84, xyz, &e, &p, &h);
 
    viv(j, 0, "eraGc2gd", "j1", status);
    vvd(e, 0.98279372324732907, 1e-14, "eraGc2gd", "e1", status);
    vvd(p, 0.97160184819075459, 1e-14, "eraGc2gd", "p1", status);
    vvd(h, 331.41724614260599, 1e-8, "eraGc2gd", "h1", status);
 
-   j = eraGc2gd(GRS80, xyz, &e, &p, &h);
+   j = eraGc2gd(ERFA_GRS80, xyz, &e, &p, &h);
 
    viv(j, 0, "eraGc2gd", "j2", status);
    vvd(e, 0.98279372324732907, 1e-14, "eraGc2gd", "e2", status);
    vvd(p, 0.97160184820607853, 1e-14, "eraGc2gd", "p2", status);
    vvd(h, 331.41731754844348, 1e-8, "eraGc2gd", "h2", status);
 
-   j = eraGc2gd(WGS72, xyz, &e, &p, &h);
+   j = eraGc2gd(ERFA_WGS72, xyz, &e, &p, &h);
 
    viv(j, 0, "eraGc2gd", "j3", status);
    vvd(e, 0.98279372324732907, 1e-14, "eraGc2gd", "e3", status);
@@ -2481,21 +2481,21 @@ static void t_gd2gc(int *status)
 
    viv(j, -1, "eraGd2gc", "j0", status);
 
-   j = eraGd2gc(WGS84, e, p, h, xyz);
+   j = eraGd2gc(ERFA_WGS84, e, p, h, xyz);
 
    viv(j, 0, "eraGd2gc", "j1", status);
    vvd(xyz[0], -5599000.5577049947, 1e-7, "eraGd2gc", "0/1", status);
    vvd(xyz[1], 233011.67223479203, 1e-7, "eraGd2gc", "1/1", status);
    vvd(xyz[2], -3040909.4706983363, 1e-7, "eraGd2gc", "2/1", status);
 
-   j = eraGd2gc(GRS80, e, p, h, xyz);
+   j = eraGd2gc(ERFA_GRS80, e, p, h, xyz);
 
    viv(j, 0, "eraGd2gc", "j2", status);
    vvd(xyz[0], -5599000.5577260984, 1e-7, "eraGd2gc", "0/2", status);
    vvd(xyz[1], 233011.6722356703, 1e-7, "eraGd2gc", "1/2", status);
    vvd(xyz[2], -3040909.4706095476, 1e-7, "eraGd2gc", "2/2", status);
 
-   j = eraGd2gc(WGS72, e, p, h, xyz);
+   j = eraGd2gc(ERFA_WGS72, e, p, h, xyz);
 
    viv(j, 0, "eraGd2gc", "j3", status);
    vvd(xyz[0], -5598998.7626301490, 1e-7, "eraGd2gc", "0/3", status);
diff --git a/src/taitt.c b/src/taitt.c
index 33175d5..4ce31bf 100644
--- a/src/taitt.c
+++ b/src/taitt.c
@@ -39,7 +39,7 @@ int eraTaitt(double tai1, double tai2, double *tt1, double *tt2)
 {
 
 /* TT minus TAI (days). */
-   static const double dtat = TTMTAI/DAYSEC;
+   static const double dtat = ERFA_TTMTAI/ERFA_DAYSEC;
 
 
 /* Result, safeguarding precision. */
diff --git a/src/taiut1.c b/src/taiut1.c
index 7e707d8..185e485 100644
--- a/src/taiut1.c
+++ b/src/taiut1.c
@@ -43,7 +43,7 @@ int eraTaiut1(double tai1, double tai2, double dta,
 
 
 /* Result, safeguarding precision. */
-   dtad = dta / DAYSEC;
+   dtad = dta / ERFA_DAYSEC;
    if ( tai1 > tai2 ) {
       *ut11 = tai1;
       *ut12 = tai2 + dtad;
diff --git a/src/taiutc.c b/src/taiutc.c
index 94bbcaa..29745ea 100644
--- a/src/taiutc.c
+++ b/src/taiutc.c
@@ -84,7 +84,7 @@ int eraTaiutc(double tai1, double tai2, double *utc1, double *utc2)
       if ( js < 0 ) return -1;
       if ( i == -1 ) dats1 = dats2;
       ddats = dats2 - dats1;
-      datd = dats1 / DAYSEC;
+      datd = dats1 / ERFA_DAYSEC;
       if ( fabs(ddats) >= 0.5 ) {
 
       /* Yes.  Get TAI for the start of the UTC day that */
@@ -99,10 +99,10 @@ int eraTaiutc(double tai1, double tai2, double *utc1, double *utc2)
          if ( da > 0 ) {
 
          /* Yes:  fraction of the current UTC day that has elapsed. */
-            fd = da * DAYSEC / ( DAYSEC + ddats );
+            fd = da * ERFA_DAYSEC / ( ERFA_DAYSEC + ddats );
 
          /* Ramp TAI-UTC to bring about ERFA's JD(UTC) convention. */
-            datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / DAYSEC;
+            datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / ERFA_DAYSEC;
          }
 
       /* Done. */
diff --git a/src/tcbtdb.c b/src/tcbtdb.c
index 1fb64b8..3a75784 100644
--- a/src/tcbtdb.c
+++ b/src/tcbtdb.c
@@ -53,11 +53,11 @@ int eraTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2)
 {
 
 /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
-   static const double t77td = DJM0 + DJM77;
-   static const double t77tf = TTMTAI/DAYSEC;
+   static const double t77td = ERFA_DJM0 + ERFA_DJM77;
+   static const double t77tf = ERFA_TTMTAI/ERFA_DAYSEC;
 
 /* TDB (days) at TAI 1977 Jan 1.0 */
-   static const double tdb0 = TDB0/DAYSEC;
+   static const double tdb0 = ERFA_TDB0/ERFA_DAYSEC;
 
    double d;
 
@@ -66,10 +66,10 @@ int eraTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2)
    if ( tcb1 > tcb2 ) {
       d = tcb1 - t77td;
       *tdb1 = tcb1;
-      *tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ELB;
+      *tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ERFA_ELB;
    } else {
       d = tcb2 - t77td;
-      *tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ELB;
+      *tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ERFA_ELB;
       *tdb2 = tcb2;
    }
 
diff --git a/src/tcgtt.c b/src/tcgtt.c
index 91c3233..6dd81bb 100644
--- a/src/tcgtt.c
+++ b/src/tcgtt.c
@@ -38,15 +38,15 @@ int eraTcgtt(double tcg1, double tcg2, double *tt1, double *tt2)
 {
 
 /* 1977 Jan 1 00:00:32.184 TT, as MJD */
-   static const double t77t = DJM77 + TTMTAI/DAYSEC;
+   static const double t77t = ERFA_DJM77 + ERFA_TTMTAI/ERFA_DAYSEC;
 
 
 /* Result, safeguarding precision. */
    if ( tcg1 > tcg2 ) {
       *tt1 = tcg1;
-      *tt2 = tcg2 - ( ( tcg1 - DJM0 ) + ( tcg2 - t77t ) ) * ELG;
+      *tt2 = tcg2 - ( ( tcg1 - ERFA_DJM0 ) + ( tcg2 - t77t ) ) * ERFA_ELG;
    } else {
-      *tt1 = tcg1 - ( ( tcg2 - DJM0 ) + ( tcg1 - t77t ) ) * ELG;
+      *tt1 = tcg1 - ( ( tcg2 - ERFA_DJM0 ) + ( tcg1 - t77t ) ) * ERFA_ELG;
       *tt2 = tcg2;
    }
 
diff --git a/src/tdbtcb.c b/src/tdbtcb.c
index e2e4e2a..12a8b6b 100644
--- a/src/tdbtcb.c
+++ b/src/tdbtcb.c
@@ -53,14 +53,14 @@ int eraTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2)
 {
 
 /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
-   static const double t77td = DJM0 + DJM77;
-   static const double t77tf = TTMTAI/DAYSEC;
+   static const double t77td = ERFA_DJM0 + ERFA_DJM77;
+   static const double t77tf = ERFA_TTMTAI/ERFA_DAYSEC;
 
 /* TDB (days) at TAI 1977 Jan 1.0 */
-   static const double tdb0 = TDB0/DAYSEC;
+   static const double tdb0 = ERFA_TDB0/ERFA_DAYSEC;
 
 /* TDB to TCB rate */
-   static const double elbb = ELB/(1.0-ELB);
+   static const double elbb = ERFA_ELB/(1.0-ERFA_ELB);
 
    double d, f;
 
diff --git a/src/tdbtt.c b/src/tdbtt.c
index 2c1a1a0..678d5bd 100644
--- a/src/tdbtt.c
+++ b/src/tdbtt.c
@@ -53,7 +53,7 @@ int eraTdbtt(double tdb1, double tdb2, double dtr,
 
 
 /* Result, safeguarding precision. */
-   dtrd = dtr / DAYSEC;
+   dtrd = dtr / ERFA_DAYSEC;
    if ( tdb1 > tdb2 ) {
       *tt1 = tdb1;
       *tt2 = tdb2 - dtrd;
diff --git a/src/tf2a.c b/src/tf2a.c
index 4eaa61a..e95744b 100644
--- a/src/tf2a.c
+++ b/src/tf2a.c
@@ -43,7 +43,7 @@ int eraTf2a(char s, int ihour, int imin, double sec, double *rad)
    *rad  = ( s == '-' ? -1.0 : 1.0 ) *
            ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
                              ( (double) abs(imin) ) ) +
-                                        fabs(sec) ) * DS2R;
+                                        fabs(sec) ) * ERFA_DS2R;
 
 /* Validate arguments and return status. */
    if ( ihour < 0 || ihour > 23 ) return 1;
diff --git a/src/tf2d.c b/src/tf2d.c
index 396e2fa..92030e3 100644
--- a/src/tf2d.c
+++ b/src/tf2d.c
@@ -43,7 +43,7 @@ int eraTf2d(char s, int ihour, int imin, double sec, double *days)
    *days  = ( s == '-' ? -1.0 : 1.0 ) *
             ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
                               ( (double) abs(imin) ) ) +
-                                         fabs(sec) ) / DAYSEC;
+                                         fabs(sec) ) / ERFA_DAYSEC;
 
 /* Validate arguments and return status. */
    if ( ihour < 0 || ihour > 23 ) return 1;
diff --git a/src/tttai.c b/src/tttai.c
index 49c9a1a..d8571fd 100644
--- a/src/tttai.c
+++ b/src/tttai.c
@@ -39,7 +39,7 @@ int eraTttai(double tt1, double tt2, double *tai1, double *tai2)
 {
 
 /* TT minus TAI (days). */
-   static const double dtat = TTMTAI/DAYSEC;
+   static const double dtat = ERFA_TTMTAI/ERFA_DAYSEC;
 
 
 /* Result, safeguarding precision. */
diff --git a/src/tttcg.c b/src/tttcg.c
index d4b752a..fc8342b 100644
--- a/src/tttcg.c
+++ b/src/tttcg.c
@@ -38,18 +38,18 @@ int eraTttcg(double tt1, double tt2, double *tcg1, double *tcg2)
 {
 
 /* 1977 Jan 1 00:00:32.184 TT, as MJD */
-   static const double t77t = DJM77 + TTMTAI/DAYSEC;
+   static const double t77t = ERFA_DJM77 + ERFA_TTMTAI/ERFA_DAYSEC;
 
 /* TT to TCG rate */
-   static const double elgg = ELG/(1.0-ELG);
+   static const double elgg = ERFA_ELG/(1.0-ERFA_ELG);
 
 
 /* Result, safeguarding precision. */
    if ( tt1 > tt2 ) {
       *tcg1 = tt1;
-      *tcg2 = tt2 + ( ( tt1 - DJM0 ) + ( tt2 - t77t ) ) * elgg;
+      *tcg2 = tt2 + ( ( tt1 - ERFA_DJM0 ) + ( tt2 - t77t ) ) * elgg;
    } else {
-      *tcg1 = tt1 + ( ( tt2 - DJM0 ) + ( tt1 - t77t ) ) * elgg;
+      *tcg1 = tt1 + ( ( tt2 - ERFA_DJM0 ) + ( tt1 - t77t ) ) * elgg;
       *tcg2 = tt2;
    }
 
diff --git a/src/tttdb.c b/src/tttdb.c
index eaeccc7..13f3bf5 100644
--- a/src/tttdb.c
+++ b/src/tttdb.c
@@ -53,7 +53,7 @@ int eraTttdb(double tt1, double tt2, double dtr,
 
 
 /* Result, safeguarding precision. */
-   dtrd = dtr / DAYSEC;
+   dtrd = dtr / ERFA_DAYSEC;
    if ( tt1 > tt2 ) {
       *tdb1 = tt1;
       *tdb2 = tt2 + dtrd;
diff --git a/src/ttut1.c b/src/ttut1.c
index a5bde57..0aab4e0 100644
--- a/src/ttut1.c
+++ b/src/ttut1.c
@@ -42,7 +42,7 @@ int eraTtut1(double tt1, double tt2, double dt,
 
 
 /* Result, safeguarding precision. */
-   dtd = dt / DAYSEC;
+   dtd = dt / ERFA_DAYSEC;
    if ( tt1 > tt2 ) {
       *ut11 = tt1;
       *ut12 = tt2 - dtd;
diff --git a/src/ut1tai.c b/src/ut1tai.c
index 326a481..bafac38 100644
--- a/src/ut1tai.c
+++ b/src/ut1tai.c
@@ -43,7 +43,7 @@ int eraUt1tai(double ut11, double ut12, double dta,
 
 
 /* Result, safeguarding precision. */
-   dtad = dta / DAYSEC;
+   dtad = dta / ERFA_DAYSEC;
    if ( ut11 > ut12 ) {
       *tai1 = ut11;
       *tai2 = ut12 - dtad;
diff --git a/src/ut1tt.c b/src/ut1tt.c
index 433d5d5..6230546 100644
--- a/src/ut1tt.c
+++ b/src/ut1tt.c
@@ -42,7 +42,7 @@ int eraUt1tt(double ut11, double ut12, double dt,
 
 
 /* Result, safeguarding precision. */
-   dtd = dt / DAYSEC;
+   dtd = dt / ERFA_DAYSEC;
    if ( ut11 > ut12 ) {
       *tt1 = ut11;
       *tt2 = ut12 + dtd;
diff --git a/src/ut1utc.c b/src/ut1utc.c
index 06e1d2b..1c0509d 100644
--- a/src/ut1utc.c
+++ b/src/ut1utc.c
@@ -102,7 +102,7 @@ int eraUt1utc(double ut11, double ut12, double dut1,
       /* UT1 for the start of the UTC day that ends in a leap. */
          if ( eraCal2jd(iy, im, id, &d1, &d2) ) return -1;
          us1 = d1;
-         us2 = d2 - 1.0 + duts/DAYSEC;
+         us2 = d2 - 1.0 + duts/ERFA_DAYSEC;
 
       /* Is the UT1 after this point? */
          du = u1 - us1;
@@ -110,7 +110,7 @@ int eraUt1utc(double ut11, double ut12, double dut1,
          if ( du > 0 ) {
 
          /* Yes:  fraction of the current UTC day that has elapsed. */
-            fd = du * DAYSEC / ( DAYSEC + ddats );
+            fd = du * ERFA_DAYSEC / ( ERFA_DAYSEC + ddats );
 
          /* Ramp UT1-UTC to bring about ERFA's JD(UTC) convention. */
             duts += ddats * ( fd <= 1.0 ? fd : 1.0 );
@@ -123,7 +123,7 @@ int eraUt1utc(double ut11, double ut12, double dut1,
    }
 
 /* Subtract the (possibly adjusted) UT1-UTC from UT1 to give UTC. */
-   u2 -= duts / DAYSEC;
+   u2 -= duts / ERFA_DAYSEC;
 
 /* Result, safeguarding precision. */
    if ( big1 ) {
diff --git a/src/utctai.c b/src/utctai.c
index 90ae697..df08925 100644
--- a/src/utctai.c
+++ b/src/utctai.c
@@ -86,7 +86,7 @@ int eraUtctai(double utc1, double utc2, double *tai1, double *tai2)
 
 /* If today ends in a leap second, scale the fraction into SI days. */
    ddat = datst - dats;
-   if ( fabs(ddat) > 0.5 ) fd += fd * ddat / DAYSEC;
+   if ( fabs(ddat) > 0.5 ) fd += fd * ddat / ERFA_DAYSEC;
 
 /* Today's calendar date to 2-part JD. */
    if ( eraCal2jd(iy, im, id, &z1, &z2) ) return -1;
@@ -94,7 +94,7 @@ int eraUtctai(double utc1, double utc2, double *tai1, double *tai2)
 /* Assemble the TAI result, preserving the UTC split and order. */
    a2 = z1 - u1;
    a2 += z2;
-   a2 += fd + dats / DAYSEC;
+   a2 += fd + dats / ERFA_DAYSEC;
    if ( big1 ) {
       *tai1 = u1;
       *tai2 = a2;
diff --git a/src/xy06.c b/src/xy06.c
index 27efb27..defca80 100644
--- a/src/xy06.c
+++ b/src/xy06.c
@@ -2558,7 +2558,7 @@ void eraXy06(double date1, double date2, double *x, double *y)
 /*--------------------------------------------------------------------*/
 
 /* Interval between fundamental date J2000.0 and given date (JC). */
-   t = ((date1 - DJ00) + date2) / DJC;
+   t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
 
 /* Powers of T. */
    w = 1.0;
@@ -2697,8 +2697,8 @@ void eraXy06(double date1, double date2, double *x, double *y)
 /* Results:  CIP unit vector components */
 /* ------------------------------------ */
 
-   *x = DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6);
-   *y = DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6);
+   *x = ERFA_DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6);
+   *y = ERFA_DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6);
 
    return;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/erfa.git



More information about the debian-science-commits mailing list