summaryrefslogtreecommitdiffstats
path: root/units.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-25 21:36:30 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-25 21:41:58 +0800
commit7f3efbdc98deeb4e4bcd481335761b6439b9552c (patch)
tree429daf20fa70a9148a4253914e705d444ea58bf8 /units.h
parent65c5d6815cf7c78231abd76440bb5bab54d9d51c (diff)
downloadsubsurface-7f3efbdc98deeb4e4bcd481335761b6439b9552c.tar.gz
Make gas mod be reasonable for users of imperial units as well
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'units.h')
-rw-r--r--units.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/units.h b/units.h
index 4b32d5237..a8c0d7dbc 100644
--- a/units.h
+++ b/units.h
@@ -16,6 +16,12 @@ extern "C" {
#define SURFACE_PRESSURE_STRING "1013"
#define ZERO_C_IN_MKELVIN 273150 // mKelvin
+#ifdef __cplusplus
+#define M_OR_FT(_m, _f) ((prefs.units.length == units::METERS) ? ((_m) * 1000) : (feet_to_mm(_f)))
+#else
+#define M_OR_FT(_m, _f) ((prefs.units.length == METERS) ? ((_m) * 1000) : (feet_to_mm(_f)))
+#endif
+
/* Salinity is expressed in weight in grams per 10l */
#define SEAWATER_SALINITY 10300
#define FRESHWATER_SALINITY 10000