+#ifndef HAVE_LOCALTIME_R
+/* If localtime_r() is not provided, we assume localtime() uses
+ * thread-specific storage. */
+# include <time.h>
+static inline struct tm *localtime_r (const time_t *timep, struct tm *result)
+{
+ struct tm *s = localtime (timep);
+ if (s == NULL)
+ return NULL;
+
+ *result = *s;
+ return result;
+}
+static inline struct tm *gmtime_r (const time_t *timep, struct tm *result)
+{
+ struct tm *s = gmtime (timep);
+ if (s == NULL)
+ return NULL;
+
+ *result = *s;
+ return result;
+}
+#endif
+
+/* Alignment of critical static data structures */
+#ifdef ATTRIBUTE_ALIGNED_MAX
+# define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
+#else
+# define ATTR_ALIGN(align)
+#endif
+
+#ifndef HAVE_USELOCALE
+typedef void *locale_t;
+# define newlocale( a, b, c ) ((locale_t)0)
+# define uselocale( a ) ((locale_t)0)
+# define freelocale( a ) (void)0
+#endif
+
+#ifdef WIN32
+# include <dirent.h>
+# define opendir Use_utf8_opendir_or_vlc_wopendir_instead!
+# define readdir Use_utf8_readdir_or_vlc_wreaddir_instead!
+# define closedir vlc_wclosedir
+#endif
+
+/* libintl support */
+#define _(str) vlc_gettext (str)
+
+#if defined (ENABLE_NLS)
+# include <libintl.h>
+#endif
+
+#define N_(str) gettext_noop (str)
+#define gettext_noop(str) (str)
+
+#endif /* !LIBVLC_FIXUPS_H */