diff --git a/stdtime/localtime.c b/stdtime/localtime.c
index ff1fa981524ca93cc0613d9dfa4d4d758a83369c..1f6309e3f430913c17a7314939a540a449882737 100755
--- a/stdtime/localtime.c
+++ b/stdtime/localtime.c
@@ -21,7 +21,9 @@
  *
  * Don't mess with these unless you're really sure you know what you're doing.
  */
+#ifndef _THREAD_SAFE
 #define _THREAD_SAFE
+#endif
 #define TZ_STRLEN_MAX	255
 /* #define DEBUG */
 #include <asterisk/lock.h>