Commit Graph

566 Commits

Author SHA1 Message Date
Mario Werner
3019a8c1fd moved code into cppformat subdirectory
Proxy headers have been placed into the project root to emit
deprecation warnings.
2016-01-29 12:49:35 +01:00
vitaut
06f3abe26d Return early from ArgMap::find 2016-01-12 06:37:39 -08:00
Michael Winterberg
4af764d040 Changed ArgMap to be backed by a vector instead of a map.
The main reason for this is to avoid a dynamic memory allocation in every format() call with Visual Studio if there are no named arguments.
2016-01-10 15:30:34 -08:00
Michael Winterberg
b203beb61d Don't define the MSVC clz functions unless __builtin_clzll is unavailable.
This is mainly just to avoid including intrin.h unnecessarily.
2016-01-07 15:38:08 -08:00
Michael Winterberg
28a303ddd4 Fixed unknown pragma warnings for _BitScanReverse.
Changed to only define the MSVC implementations for clz and clzll if the builtins are not available to avoid warnings about an unknown #pragma for "intrinsic".
2016-01-06 14:42:27 -08:00
Michael Winterberg
7185e96da1 Fixed issues with MSVC emulations of clz and clzll.
Both clang-cl and Clang/C2 #define _MSC_VER but also have support for __builtin_clz and __builtin_clzll, leading to duplicate macro definition warnings. Emulation of clz using _BitScanReverse is suppressed if the builtins are already available.

Additionally, the value of the output parameter of _BitScanReverse is undefined if the input value is 0, which is avoided by construction, so the code analysis warning for using uninitialized data is now suppressed.
2016-01-05 16:03:06 -08:00
Michael Winterberg
251a0869be Fixed macro redefinition warnings when compiling with clang-cl.
Both clang-cl and Clang/C2 #define _MSC_VER but also have support for __builtin_clz and __builtin_clzll, leading to duplicate macro definition warnings. This change suppresses emulation of clz using _BitScanReverse if the __clang__ macro is defined.
2016-01-01 18:07:06 -08:00
Nicholas Hutchinson
1a5a1708b7 Add fprintf overload that writes to a std::ostream
For completeness, add an overload for printf that takes a std::ostream.
2015-12-23 15:59:13 +13:00
vitaut
4797ca025e POD -> trivially copyable/constructible 2015-12-20 07:29:59 -08:00
Dean Moldovan
b098306839 Replace template recursion with array initialization 2015-12-19 18:19:18 +01:00
Dean Moldovan
a721319e3a Add MakeArg constructor for Arg 2015-12-19 18:19:18 +01:00
vitaut
29726cefb8 Remove extra '*'s 2015-12-18 07:30:03 -08:00
vitaut
0629d76bb0 Fallback to sized integer types on MSVC if stdint.h is not available 2015-12-18 07:20:05 -08:00
vitaut
1042ddda0f Document BasicFormatter 2015-12-18 07:07:41 -08:00
vitaut
1cba0aea27 Simplify CMake config and do minor adjustments
for consistency with used coding conventions.
2015-12-10 07:24:23 -08:00
Maciej Dems
c47318afa8 Declarations for shared library in Windows.
Added __declspec(dllimport) and __declspec(dllexport) declarations
when compiled in Windows.
2015-12-10 13:36:18 +01:00
vitaut
ecd52bc610 Fix for a bogus MSVC warning (#244) 2015-12-09 08:57:29 -08:00
vitaut
5c76d107cb Fix MSVC build 2015-12-06 14:17:34 -08:00
vitaut
98c1f76f24 Replace uninitialized_copy with memmove (#242)
because the memory areas may overlap.
2015-12-06 07:44:07 -08:00
vitaut
e7f4566dd4 Replace <algorithm> with <memory>
~20% faster compile time on bloat-test
2015-12-04 22:57:36 -08:00
vitaut
e0179ee190 Fix a warning and remove extra newline 2015-12-04 17:52:36 -08:00
vitaut
e567fe6960 Replace "!!" with "!= 0" for readability 2015-12-04 17:52:06 -08:00
vitaut
7c60db1e24 Fix a warning 2015-12-04 14:12:42 -08:00
vitaut
535dbdd1c8 Move formatter methods to the header
and improve naming consistency
2015-12-03 09:38:06 -08:00
vitaut
6ced4230f4 Initial support for custom formatters 2015-12-02 08:41:05 -08:00
Johan 't Hart
328c8888ec Make compilable under Visual Studio 2008
Older Visual Studio versions are not shipped with stdint.h
2015-12-01 09:34:13 +01:00
Johan 't Hart
df2dfd9612 Silence some performance warnings in Visual Studio 2015-12-01 08:59:59 +01:00
vitaut
7cbb29f61e Make FormatBuf::size() const 2015-11-25 08:27:46 -08:00
vitaut
053df632f8 Minor simplification and adjustment of coding style for consistency
in custom stream buffer implementation:

* basic_formatbuf -> internal::FormatBuf
* remove unused Traits template argument
2015-11-25 08:00:57 -08:00
vitaut
222f2d28f5 Fix MSVC warnings 2015-11-25 07:47:43 -08:00
vitaut
f60c4b9947 Fix an MSVC warning (#234) 2015-11-25 07:17:05 -08:00
vitaut
0519737b95 Don't use _ecvt (#233) 2015-11-25 07:11:28 -08:00
vitaut
9a08fb52bf Fix compilation with clang and old libstdc++ 2015-11-24 09:13:48 -08:00
Michael Kasperovich
8265263c5d Remove unnecessary stuff. 2015-11-24 09:09:09 -08:00
Michael Kasperovich
d266adf805 Implement custom stream buffer (#92) 2015-11-24 09:06:33 -08:00
vitaut
6cff6d8137 Use overloaded operator<< for enums if available (#232) 2015-11-24 08:18:19 -08:00
vitaut
646829e34d Fix MSVC warnings 2015-11-21 07:31:00 -08:00
vitaut
8beadace37 Improve detection of isinf, isnan and getsign 2015-11-21 07:20:18 -08:00
vitaut
223575b567 Tyop 2015-11-20 08:28:29 -08:00
vitaut
ee3e68dc16 Improve compatibility with bcc32 2015-11-20 08:14:10 -08:00
vitaut
e5d599875c Improve compatibility with bcc32 2015-11-20 07:56:16 -08:00
vitaut
b53994fd0d Suppress a warning 2015-11-20 07:49:29 -08:00
vitaut
fd1753484e Fix example 2015-11-19 07:23:43 -08:00
vitaut
6606971aae Improve compatibility with bcc32 2015-11-18 08:42:09 -08:00
vitaut
31aced8b59 Improve compatibility with bcc32 2015-11-18 08:04:04 -08:00
vitaut
1dd5e035eb Simplify signbit 2015-11-18 07:38:05 -08:00
vitaut
0219d5591b Improve compatibility with bcc32 2015-11-17 08:53:15 -08:00
vitaut
3a2f91bd58 Fallback to ecvt if _ecvt_s is not available. 2015-11-17 08:35:30 -08:00
vitaut
c1a8dfe555 Improve detection of signbit 2015-11-17 07:40:22 -08:00
Victor Zverovich
d9e0f5c04e Merge pull request #229 from LogicalKnight/fix_intel_warning
Fix warning when using Intel C++ on OS X
2015-11-13 16:48:34 -08:00