[F] Fixed c++ support

This commit is contained in:
seleznevae
2018-03-18 12:17:33 +03:00
parent 5ad1ede916
commit 757502a4b8
7 changed files with 101 additions and 68 deletions

View File

@@ -29,10 +29,10 @@ SOFTWARE.
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
#include "options.h"
/*
* Determine compiler
*/
@@ -51,21 +51,20 @@ SOFTWARE.
/*
* Declare restrict
*/
//#if defined(__cplusplus)
//#if defined(FT_CLANG_COMPILER)
//#define FT_RESTRICT __restrict__
//#else
//#define FT_RESTRICT __restrict
//#endif /* if defined(FT_CLANG_COMPILER) */
//#else
//#if __STDC_VERSION__ < 199901L
//#define FT_RESTRICT
//#else
//#define FT_RESTRICT restrict
//#endif /* __STDC_VERSION__ < 199901L */
//#endif /* if defined(__cplusplus) */
#if defined(__cplusplus)
#if defined(FT_CLANG_COMPILER)
#define FT_RESTRICT __restrict__
#else
#define FT_RESTRICT __restrict
#endif /* if defined(FT_CLANG_COMPILER) */
#else
#if __STDC_VERSION__ < 199901L
#define FT_RESTRICT
#else
#define FT_RESTRICT restrict
#endif /* __STDC_VERSION__ < 199901L */
#endif /* if defined(__cplusplus) */
#define FT_RESTRICT
/*
@@ -269,10 +268,39 @@ FT_EXTERN int ft_add_separator(FTABLE *FT_RESTRICT table);
FT_EXTERN const char* ft_to_string(const FTABLE *FT_RESTRICT table);
/*
* Setting table appearance
*/
#define FT_ANY_COLUMN (UINT_MAX)
#define FT_ANY_ROW (UINT_MAX)
#define FT_ROW_UNSPEC (UINT_MAX-1)
#define FT_COLUMN_UNSPEC (UINT_MAX-1)
#define FT_OPT_MIN_WIDTH ((uint32_t)(0x01U << (0)))
#define FT_OPT_TEXT_ALIGN ((uint32_t)(0x01U << (1)))
#define FT_OPT_TOP_PADDING ((uint32_t)(0x01U << (2)))
#define FT_OPT_BOTTOM_PADDING ((uint32_t)(0x01U << (3)))
#define FT_OPT_LEFT_PADDING ((uint32_t)(0x01U << (4)))
#define FT_OPT_RIGHT_PADDING ((uint32_t)(0x01U << (5)))
#define FT_OPT_EMPTY_STR_HEIGHT ((uint32_t)(0x01U << (6)))
#define FT_OPT_ROW_TYPE ((uint32_t)(0x01U << (7)))
enum TextAlignment
{
LeftAligned,
CenterAligned,
RightAligned
};
enum RowType
{
Common,
Header
};
struct ft_border_chars
{
@@ -308,7 +336,9 @@ FT_EXTERN int ft_set_option(FTABLE * FT_RESTRICT table, unsigned row, unsigned c
/*
* WChar support
*/
#ifdef FT_HAVE_WCHAR