1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-23 02:38:53 -05:00
Commit Graph

2 Commits

Author SHA1 Message Date
Pascal Thomet 49db527db1
Support long & long double, add macro INSTANTIATE_FOR_NUMERIC_TYPES (Fix #319) (#397)
* implot_items: INSTANTIATE_FOR_NUMERIC_TYPES / add long & long double (Fix #319)

- INSTANTIATE_FOR_NUMERIC_TYPES is a macro which instantiates templated plotting functions for numeric types.
This macro helps reduce some boilerplate code for template functions instantiations.

- Added optional support for more numeric types (long and long double)
The numeric type list does not include "long", "unsigned long" and "long double".
Most of the time, it is not an issue when linking statically.
However, when linking dynamically, issues related to undefined functions can arise:
although those types might have the same size, they are considered separate.

define IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES) in order to define versions for those types

In this case, the compilation time for this specific file will be 33% longer

- implot_internal.h / ImMean and ImStdDev: added cast  to double
(suppress MSVC warning about downcasting)

- Notes about numeric types "synonyms":
  Even if "long double" and "double" might occupy the same size,
they are not complete synonyms, and it is legal to define overloads for both double and long double.
  On some platforms, "unsigned long" might be the same size as "unsigned long long",
but it is nonetheless a separate type: see https://godbolt.org/z/1KWv5re7q (example with GCC 64 bits)
  On some other platforms, "long double" might be the same size as "double", but it is nonetheless a separate type: see https://godbolt.org/z/ae71P7rqG (example with MSVC 64 bits)

* IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES: disabled by default

* uppercase template instantiatation macros & group them

* implot_items.cpp: reword comments on IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES

* README.md: mention compile-time option IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES

* Github CI: IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES=1
2022-09-11 09:43:27 -05:00
Rokas Kupstys fd16fe001c
CI setup (#395)
* Fix truncation warnings.

* CI: GitHub Actions CI setup.
2022-09-06 18:28:32 -05:00