paps
paps copied to clipboard
Fix/improve i18n related thing
This contains a fix of the build fail with enabling NLS support on BSD-based system.
Fixes https://github.com/dov/paps/issues/59
Hello,
I've tested patch and I've got (FreeBSD):
Making all in src
--- paps-paps.o ---
--- paps-format_from_dict.o ---
--- paps-paps.o ---
c++ -DHAVE_CONFIG_H -I. -I.. -DGETTEXT_PACKAGE='"paps"' -DDATADIR='"/usr/local/"' -I/usr/local/include -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/u
sr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/i
nclude/pixman-1 -D_THREAD_SAFE -D_THREAD_SAFE -D_THREAD_SAFE -D_THREAD_SAFE -pthread -D_THREAD_SAFE -D_THREAD_SAFE -I/usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing
-MT paps-paps.o -MD -MP -MF .deps/paps-paps.Tpo -c -o paps-paps.o `test -f 'paps.cc' || echo './'`paps.cc
--- paps-format_from_dict.o ---
c++ -DHAVE_CONFIG_H -I. -I.. -DGETTEXT_PACKAGE='"paps"' -DDATADIR='"/usr/local/"' -I/usr/local/include -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/u
sr/local/lib/glib-2.0/include -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/local/include/cairo -I/usr/local/i
nclude/pixman-1 -D_THREAD_SAFE -D_THREAD_SAFE -D_THREAD_SAFE -D_THREAD_SAFE -pthread -D_THREAD_SAFE -D_THREAD_SAFE -I/usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing
-MT paps-format_from_dict.o -MD -MP -MF .deps/paps-format_from_dict.Tpo -c -o paps-format_from_dict.o `test -f 'format_from_dict.cc' || echo './'`format_from_dict.cc
In file included from format_from_dict.cc:23:
./format_from_dict.h:30:23: error: no template named 'variant' in namespace 'std'
using scalar_t = std::variant<int, std::string, double, std::time_t>;
~~~~~^
./format_from_dict.h:31:38: error: use of undeclared identifier 'scalar_t'
using dict_t = std::map<std::string, scalar_t>;
^
./format_from_dict.h:36:30: error: unknown type name 'dict_t'
dict_t dict);
^
format_from_dict.cc:28:32: error: unknown type name 'scalar_t'
static string scalar_to_string(scalar_t scalar,
^
format_from_dict.cc:65:25: error: unknown type name 'dict_t'
dict_t dict)
^
--- paps-paps.o ---
In file included from paps.cc:42:
./format_from_dict.h:30:23: error: no template named 'variant' in namespace 'std'
using scalar_t = std::variant<int, std::string, double, std::time_t>;
~~~~~^
./format_from_dict.h:31:38: error: use of undeclared identifier 'scalar_t'
using dict_t = std::map<std::string, scalar_t>;
^
./format_from_dict.h:36:30: error: unknown type name 'dict_t'
dict_t dict);
^
paps.cc:160:3: error: unknown type name 'dict_t'
dict_t document_info;
^
paps.cc:221:45: error: unknown type name 'dict_t'
dict_t& document_info,
^
paps.cc:227:45: error: unknown type name 'dict_t'
dict_t& document_info);
^
Any clues?
Thanks
Which C++ did you use? If they support C++17, std::variant class should be available.
Sorry! I forgot to add c++17 std. It builds fine!
Thanks
Oops, I forgot to make nls support optional in meson build.
Oops, I forgot to make nls support optional in meson build.
I will do further tests to see if port needs an NLS knob to turn it on/off by adding an option.