cow-string-inst.lo cow-string-inst.o: string-inst.cc
endif
-if USE_STATIC_TZDATA
-tzdata.zi.h: $(top_srcdir)/src/c++20/tzdata.zi
- echo 'static const char tzdata_chars[] = R"__libstdcxx__(' > $@.tmp
- cat $^ >> $@.tmp
- echo ')__libstdcxx__";' >> $@.tmp
- mv $@.tmp $@
-
-tzdb.lo: tzdb.cc tzdata.zi.h
- $(LTCXXCOMPILE) -I. -c $<
-tzdb.o: tzdb.cc tzdata.zi.h
- $(CXXCOMPILE) -I. -c $<
-endif
-
# This needs access to std::text_encoding and to the internals of std::locale.
format.lo: format.cc
$(LTCXXCOMPILE) -std=gnu++26 -fno-access-control -c $<
# These files should be rebuilt if the .cc prerequisite changes.
@ENABLE_DUAL_ABI_TRUE@cow-string-inst.lo cow-string-inst.o: string-inst.cc
-@USE_STATIC_TZDATA_TRUE@tzdata.zi.h: $(top_srcdir)/src/c++20/tzdata.zi
-@USE_STATIC_TZDATA_TRUE@ echo 'static const char tzdata_chars[] = R"__libstdcxx__(' > $@.tmp
-@USE_STATIC_TZDATA_TRUE@ cat $^ >> $@.tmp
-@USE_STATIC_TZDATA_TRUE@ echo ')__libstdcxx__";' >> $@.tmp
-@USE_STATIC_TZDATA_TRUE@ mv $@.tmp $@
-
-@USE_STATIC_TZDATA_TRUE@tzdb.lo: tzdb.cc tzdata.zi.h
-@USE_STATIC_TZDATA_TRUE@ $(LTCXXCOMPILE) -I. -c $<
-@USE_STATIC_TZDATA_TRUE@tzdb.o: tzdb.cc tzdata.zi.h
-@USE_STATIC_TZDATA_TRUE@ $(CXXCOMPILE) -I. -c $<
-
# This needs access to std::text_encoding and to the internals of std::locale.
format.lo: format.cc
$(LTCXXCOMPILE) -std=gnu++26 -fno-access-control -c $<
const string_view leaps_file = "/leapseconds";
#ifdef _GLIBCXX_STATIC_TZDATA
-// Static copy of tzdata.zi embedded in the library as tzdata_chars[]
-#include "tzdata.zi.h"
+// Static copy of tzdata.zi embedded in the library.
+static constexpr char tzdata_chars[] = {
+#embed "tzdata.zi"
+};
#endif
// An istream type that can read from a file or from a string.
{
#ifdef _GLIBCXX_STATIC_TZDATA
char* p = const_cast<char*>(tzdata_chars);
- this->setg(p, p, p + std::size(tzdata_chars) - 1);
+ this->setg(p, p, p + std::size(tzdata_chars));
#endif
}