[libconfig] update to 1.7.1

This commit is contained in:
Ivy Snow 2017-12-26 12:43:00 +08:00
parent 544e99310d
commit c8cddb849a
6 changed files with 8 additions and 1358 deletions

View File

@ -3,26 +3,26 @@ project(libconfig C CXX)
if(MSVC)
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS)
add_definitions(-Dscandir=libconfig_scandir)
endif()
set(C_SOURCES
lib/grammar.c
lib/libconfig.c
lib/scanctx.c
lib/win32/scandir.c
lib/scanner.c
lib/strbuf.c
lib/strvec.c
lib/util.c
lib/wincompat.c
)
set(CPP_SOURCES
lib/libconfigcpp.cc
)
find_path(DIRENT_H dirent.h)
find_path(STDINT_H stdint.h)
include_directories(lib ${DIRENT_H} ${STDINT_H})
include_directories(lib ${STDINT_H})
add_definitions(-DYY_NO_UNISTD_H -DYY_USE_CONST)
@ -37,6 +37,7 @@ else()
target_compile_definitions(libconfig++ PUBLIC -DLIBCONFIGXX_STATIC)
endif()
target_link_libraries(libconfig shlwapi)
target_link_libraries(libconfig++ PRIVATE libconfig)
install(

View File

@ -1,4 +1,3 @@
Source: libconfig
Version: 1.6.0-1
Version: 1.7.1
Description: C/C++ library for processing configuration files
Build-Depends: dirent

View File

@ -1,108 +0,0 @@
diff --git a/lib/scanner.h b/lib/scanner.h
index cdca3bb..1fc0509 100644
--- a/lib/scanner.h
+++ b/lib/scanner.h
@@ -13,7 +13,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 39
+#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -132,7 +132,15 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
@@ -162,7 +170,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- yy_size_t yy_n_chars;
+ int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -206,13 +214,13 @@ void libconfig_yypop_buffer_state (yyscan_t yyscanner );
YY_BUFFER_STATE libconfig_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE libconfig_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
+YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
void *libconfig_yyalloc (yy_size_t ,yyscan_t yyscanner );
void *libconfig_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
void libconfig_yyfree (void * ,yyscan_t yyscanner );
-#define libconfig_yywrap(yyscanner) 1
+#define libconfig_yywrap(n) 1
#define YY_SKIP_YYWRAP
#define yytext_ptr yytext_r
@@ -221,7 +229,8 @@ void libconfig_yyfree (void * ,yyscan_t yyscanner );
#define INITIAL 0
#define COMMENT 1
#define STRING 2
-#define INCLUDE 3
+#define INCLUDE_F 3
+#define INCLUDE_D 4
#endif
@@ -260,7 +269,7 @@ FILE *libconfig_yyget_out (yyscan_t yyscanner );
void libconfig_yyset_out (FILE * out_str ,yyscan_t yyscanner );
-yy_size_t libconfig_yyget_leng (yyscan_t yyscanner );
+int libconfig_yyget_leng (yyscan_t yyscanner );
char *libconfig_yyget_text (yyscan_t yyscanner );
@@ -268,10 +277,6 @@ int libconfig_yyget_lineno (yyscan_t yyscanner );
void libconfig_yyset_lineno (int line_number ,yyscan_t yyscanner );
-int libconfig_yyget_column (yyscan_t yyscanner );
-
-void libconfig_yyset_column (int column_no ,yyscan_t yyscanner );
-
YYSTYPE * libconfig_yyget_lval (yyscan_t yyscanner );
void libconfig_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
@@ -302,7 +307,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Number of entries by which start-condition stack grows. */
@@ -337,8 +347,8 @@ extern int libconfig_yylex \
#undef YY_DECL
#endif
-#line 207 "scanner.l"
+#line 315 "scanner.l"
-#line 343 "scanner.h"
+#line 353 "scanner.h"
#undef libconfig_yyIN_HEADER
#endif /* libconfig_yyHEADER_H */

File diff suppressed because it is too large Load Diff

View File

@ -3,20 +3,12 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO hyperrealm/libconfig
REF v1.6
SHA512 6222110851970fda11d21e73bc322be95fb1ce62c513e2f4cc7875d7b32d1d211860971692db679edf8ac46151033a132fc669bd16590fec56360ef3a6e584f8
REF v1.7.1
SHA512 b58b468e9e2d5175fbde1ad9765c6604dc9b3f3944613a88404a45d0d232e7d79a47321bf3c06b97cb46a2104b4313fad5c7f8944149f550b7af51ad523e775e
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fix-scanner-source-msvc-patch.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-scanner-header-msvc-patch.patch"
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/scandir.c DESTINATION ${SOURCE_PATH}/lib/win32)
vcpkg_configure_cmake(

View File

@ -1,112 +0,0 @@
// "$Id: scandir.c 1339 2006-04-03 22:47:29Z spitzak $"
//
// Copyright 1998-2006 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to "fltk-bugs@fltk.org".
// Emulation of posix scandir() call
// This source file is #include'd by scandir.c
// THIS IS A C FILE! DO NOT CHANGE TO C++!!!
// See @http://www.fltk.org/strfiles/1779/scandir.c
#include <string.h>
#include <windows.h>
#include <stdlib.h>
#include <io.h>
#include <dirent.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef FILENAME_MAX
#define FILENAME_MAX 2048
#endif
/**
* The scandir() function reads the directory dirname and builds an array of
* pointers to directory entries. It returns the number of entries in the array.
* A pointer to the array of directory entries is stored in the location
* referenced by namelist.
*/
int libconfig_scandir(const char *dirname, struct dirent ***namelist,
int (*select)(struct dirent *),
int (*compar)(struct dirent **, struct dirent **)) {
char *d;
WIN32_FIND_DATA find;
HANDLE h;
int nDir = 0, NDir = 0;
struct dirent **dir = 0, *selectDir;
unsigned long ret;
char findIn[MAX_PATH*4];
//utf8tomb(dirname, strlen(dirname), findIn, _MAX_PATH);
strcpy(findIn, dirname);
d = findIn+strlen(findIn);
if (d==findIn) *d++ = '.';
if (*(d-1)!='/' && *(d-1)!='\\') *d++ = '/';
*d++ = '*';
*d++ = 0;
if ((h=FindFirstFile(findIn, &find))==INVALID_HANDLE_VALUE) {
ret = GetLastError();
if (ret != ERROR_NO_MORE_FILES) {
// TODO: return some error code
}
*namelist = dir;
return nDir;
}
do {
selectDir=(struct dirent*)malloc(sizeof(struct dirent));
strcpy(selectDir->d_name, find.cFileName);
if (!select || (*select)(selectDir)) {
if (nDir==NDir) {
struct dirent **tempDir = (struct dirent **)calloc(sizeof(struct dirent*), NDir+33);
if (NDir) memcpy(tempDir, dir, sizeof(struct dirent*)*NDir);
if (dir) free(dir);
dir = tempDir;
NDir += 32;
}
dir[nDir] = selectDir;
nDir++;
dir[nDir] = 0;
} else {
free(selectDir);
}
} while (FindNextFile(h, &find));
ret = GetLastError();
if (ret != ERROR_NO_MORE_FILES) {
// TODO: return some error code
}
FindClose(h);
if (compar) qsort (dir, nDir, sizeof(*dir),
(int(*)(const void*, const void*))compar);
*namelist = dir;
return nDir;
}
#ifdef __cplusplus
}
#endif
//
// End of "$Id: scandir.c 1339 2006-04-03 22:47:29Z spitzak $".
//