Improve long formatters
diff --git a/include/fmt/core.h b/include/fmt/core.h
index 4ca9c3f..46e73e7 100644
--- a/include/fmt/core.h
+++ b/include/fmt/core.h
@@ -2704,8 +2704,8 @@
 FMT_FORMAT_AS(unsigned char, unsigned);
 FMT_FORMAT_AS(short, int);
 FMT_FORMAT_AS(unsigned short, unsigned);
-FMT_FORMAT_AS(long, long long);
-FMT_FORMAT_AS(unsigned long, unsigned long long);
+FMT_FORMAT_AS(long, detail::long_type);
+FMT_FORMAT_AS(unsigned long, detail::ulong_type);
 FMT_FORMAT_AS(std::basic_string<Char>, basic_string_view<Char>);
 FMT_FORMAT_AS(std::nullptr_t, const void*);
 FMT_FORMAT_AS(detail::std_string_view<Char>, basic_string_view<Char>);