diff options
authorNeels Hofmeyr <neels@hofmeyr.de>2018-08-20 12:41:36 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-08-20 12:41:36 +0200
commitc36e61e3dc0212649e2560bfbd56a728dbefb24d (patch)
parent060a6c4d972b73a9e31f8d8bd13b67fd4d0b9a99 (diff)
use __FILE__, not __BASE_FILE__
The intention was to use the file's basename, but __BASE_FILE__ means "the root file that is being parsed and contains #include statements". If we had a function using __BASE_FILE__ and that was defined in an #included file, __BASE_FILE__ would indicate the first file where the #include is, and not the file where the function is defined. __BASE_FILE__ works for us because we don't ever include function definitions that log something, so __BASE_FILE__ always coincides with __FILE__ for our logging; but still __BASE_FILE__ is semantically the wrong constant. Related: OS#2740 Change-Id: I1c8122c909938daaf782468c1c5b0262d555c3ce
2 files changed, 9 insertions, 9 deletions
diff --git a/include/osmocom/msc/osmo_msc.h b/include/osmocom/msc/osmo_msc.h
index 995b19592..7b3702abc 100644
--- a/include/osmocom/msc/osmo_msc.h
+++ b/include/osmocom/msc/osmo_msc.h
@@ -101,9 +101,9 @@ static inline const char *msc_subscr_conn_use_name(enum msc_subscr_conn_use val)
{ return get_value_string(msc_subscr_conn_use_names, val); }
#define msc_subscr_conn_get(conn, balance_token) \
- _msc_subscr_conn_get(conn, balance_token, __BASE_FILE__, __LINE__)
+ _msc_subscr_conn_get(conn, balance_token, __FILE__, __LINE__)
#define msc_subscr_conn_put(conn, balance_token) \
- _msc_subscr_conn_put(conn, balance_token, __BASE_FILE__, __LINE__)
+ _msc_subscr_conn_put(conn, balance_token, __FILE__, __LINE__)
struct gsm_subscriber_connection *
_msc_subscr_conn_get(struct gsm_subscriber_connection *conn,
enum msc_subscr_conn_use balance_token,
diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index 91c28dbd8..386a548f7 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -326,19 +326,19 @@ const char *vlr_subscr_name(struct vlr_subscr *vsub);
const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub);
#define vlr_subscr_find_by_imsi(vlr, imsi) \
- _vlr_subscr_find_by_imsi(vlr, imsi, __BASE_FILE__, __LINE__)
+ _vlr_subscr_find_by_imsi(vlr, imsi, __FILE__, __LINE__)
#define vlr_subscr_find_or_create_by_imsi(vlr, imsi, created) \
_vlr_subscr_find_or_create_by_imsi(vlr, imsi, created, \
- __BASE_FILE__, __LINE__)
+ __FILE__, __LINE__)
#define vlr_subscr_find_by_tmsi(vlr, tmsi) \
- _vlr_subscr_find_by_tmsi(vlr, tmsi, __BASE_FILE__, __LINE__)
+ _vlr_subscr_find_by_tmsi(vlr, tmsi, __FILE__, __LINE__)
#define vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created) \
_vlr_subscr_find_or_create_by_tmsi(vlr, tmsi, created, \
- __BASE_FILE__, __LINE__)
+ __FILE__, __LINE__)
#define vlr_subscr_find_by_msisdn(vlr, msisdn) \
- _vlr_subscr_find_by_msisdn(vlr, msisdn, __BASE_FILE__, __LINE__)
+ _vlr_subscr_find_by_msisdn(vlr, msisdn, __FILE__, __LINE__)
struct vlr_subscr *_vlr_subscr_find_by_imsi(struct vlr_instance *vlr,
const char *imsi,
@@ -362,8 +362,8 @@ struct vlr_subscr *_vlr_subscr_find_by_msisdn(struct vlr_instance *vlr,
const char *msisdn,
const char *file, int line);
-#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __BASE_FILE__, __LINE__)
-#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __BASE_FILE__, __LINE__)
+#define vlr_subscr_get(sub) _vlr_subscr_get(sub, __FILE__, __LINE__)
+#define vlr_subscr_put(sub) _vlr_subscr_put(sub, __FILE__, __LINE__)
struct vlr_subscr *_vlr_subscr_get(struct vlr_subscr *sub, const char *file, int line);
struct vlr_subscr *_vlr_subscr_put(struct vlr_subscr *sub, const char *file, int line);