]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
include/asterisk/time.h: Renamed global declaration:tv 35/1935/1
authorDiederik de Groot <ddegroot@talon.nl>
Thu, 7 Jan 2016 09:21:03 +0000 (10:21 +0100)
committerMark Michelson <mmichelson@digium.com>
Fri, 8 Jan 2016 19:32:31 +0000 (13:32 -0600)
Renamed global declaration:tv to dummy_tv_var_for_types,
which would oltherwise cause 'shadow' warnings when 'tv'
was declared as a local variable elsewhere.

Added comment to note that dummy_tv_var_for_types is never
really exported and only used as a place holder.

ASTERISK-25627 #close

Change-Id: I9a6e17995006584f3627efe8988e3f8aa0f5dc28

include/asterisk/time.h

index dd68db7044e50498c845ba9ef18876183cac100d..f67f488d071da27e6955103d3c39b95a2ea52643 100644 (file)
 
 /* We have to let the compiler learn what types to use for the elements of a
    struct timeval since on linux, it's time_t and suseconds_t, but on *BSD,
-   they are just a long. */
-extern struct timeval tv;
-typedef typeof(tv.tv_sec) ast_time_t;
-typedef typeof(tv.tv_usec) ast_suseconds_t;
+   they are just a long.
+   note:dummy_tv_var_for_types never actually gets exported, only used as
+   local place holder. */
+extern struct timeval dummy_tv_var_for_types;
+typedef typeof(dummy_tv_var_for_types.tv_sec) ast_time_t;
+typedef typeof(dummy_tv_var_for_types.tv_usec) ast_suseconds_t;
 
 /*!
  * \brief Computes the difference (in seconds) between two \c struct \c timeval instances.