#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test recognition of ISO C 99 <inttypes.h> format string directives.

cat <<EOF > xg-c-8.c
void foo ()
{
  printf (_("File size is: %" PRId64), size);
  printf (_("File age is %10" PRIdMAX " microseconds"), age);
  printf (_(PRIXFAST16 " errors"), nerrs);
  printf (_(PRIXFAT16 " mistakes"), nerrs);
}
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -k_ -o xg-c-8.tmp xg-c-8.c || Exit 1
LC_ALL=C tr -d '\r' < xg-c-8.tmp > xg-c-8.po || Exit 1

cat <<EOF > xg-c-8.ok
#, c-format
msgid "File size is: %<PRId64>"
msgstr ""

#, c-format
msgid "File age is %10<PRIdMAX> microseconds"
msgstr ""

#, c-format
msgid "<PRIXFAST16> errors"
msgstr ""

#, c-format
msgid " mistakes"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-c-8.ok xg-c-8.po
result=$?

exit $result
