Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 240a106

Browse files
authored
Merge pull request #431 from wilx/master
Merge.
2 parents 4b774f5 + 09e703a commit 240a106

File tree

9 files changed

+125
-51
lines changed

9 files changed

+125
-51
lines changed

ConfigureChecks.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ check_function_exists(getpid LOG4CPLUS_HAVE_GETPID )
6363
check_function_exists(poll LOG4CPLUS_HAVE_POLL )
6464
check_function_exists(pipe LOG4CPLUS_HAVE_PIPE )
6565
check_function_exists(pipe2 LOG4CPLUS_HAVE_PIPE2 )
66+
check_function_exists(accept4 LOG4CPLUS_HAVE_ACCEPT4 )
6667
check_function_exists(ftime LOG4CPLUS_HAVE_FTIME )
6768
check_function_exists(stat LOG4CPLUS_HAVE_STAT )
6869
check_function_exists(lstat LOG4CPLUS_HAVE_LSTAT )

README.md

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Short Description
44
=================
55

6-
[log4cplus] is a simple to use C++11 logging API providing thread--safe,
6+
[log4cplus] is a simple to use C++17 logging API providing thread--safe,
77
flexible, and arbitrarily granular control over log management and
88
configuration. It is modeled after the Java log4j API.
99

@@ -36,11 +36,11 @@ from log4net, log4cxx, log4cpp).
3636
Platform support
3737
================
3838

39-
[log4cplus] version 2.0 and beyond require C++11. [log4cplus] has been
39+
[log4cplus] version 3.0 and beyond require C++17. [log4cplus] has been
4040
ported to and tested on the following platforms:
4141

42-
- Linux/AMD64 with GCC version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)
43-
- Linux/AMD64 with Clang version 3.8.1-12ubuntu1 (tags/RELEASE_381/final)
42+
- Linux/AMD64 with GCC version 8.3.0 (Ubuntu 8.3.0-6ubuntu1)
43+
- Linux/AMD64 with Clang version 8.0.0-3 (tags/RELEASE_800/final)
4444
- Windows/AMD64 with GCC version 4.8.2 (x86_64-posix-seh-rev3, Built by
4545
MinGW-W64 project) using CMake build system
4646
- Windows/AMD64 with GCC version 4.9.2 (tdm64-1) using CMake build system
@@ -59,8 +59,8 @@ on Linux platform offered by [Travis CI][11] service.
5959
The oldest Windows version that is supported by 2.x releases is Windows Vista.
6060

6161
The following platforms were supported by the 1.x series of [log4cplus]. They
62-
either do not have a reasonable C++11 capable compiler or have not been checked
63-
with [log4cplus] 2.x, yet:
62+
either do not have a reasonable C++17 capable compiler or have not been checked
63+
with [log4cplus] 3.x, yet:
6464

6565
- Minix 3.3.0/i386 with Clang version 3.4 (branches/release_34) with
6666
`--disable-threads`
@@ -150,6 +150,36 @@ help with configuration by supplying additional flags to the
150150
Linux. See one of the later note for details.
151151

152152

153+
`--enable-tests`
154+
----------------
155+
156+
This option is enabled by default. It enables compilation of test executables.
157+
158+
159+
`--enable-unit-tests`
160+
---------------------
161+
162+
This option is disabled by default. It enables compilation of unit tests along
163+
their units. These unit tests then can be executed through `unit_tests` test
164+
executable that is built during compilation.
165+
166+
167+
`--enable-implicit-initialization`
168+
----------------------------------
169+
170+
This option is enabled by default. It enables implicit initialization of
171+
[log4cplus]. When it is turned off, [log4cplus] has to be explicitly
172+
initialized by calling either `log4cplus::initialize()` or by instantiating
173+
`log4cplus::Initializer`.
174+
175+
176+
`--enable-lto`
177+
--------------
178+
179+
This option is disabled by default. It enables LTO (Link-Time Optimization)
180+
builds.
181+
182+
153183
`--with-wchar_t-support`
154184
------------------------
155185

@@ -205,18 +235,12 @@ separate shared library (liblog4cplusqt4debugappender) that implements
205235
`Qt4DebugAppender`. It requires Qt4 and pkg-config to be installed.
206236

207237

208-
`--enable-tests`
209-
---------------------
210-
211-
This option is enabled by default. It enables compilation of test executables.
212-
213-
214-
`--enable-unit-tests`
215-
---------------------
238+
`--with-qt5`
239+
------------
216240

217-
This option is disabled by default. It enables compilation of unit tests along
218-
their units. These unit tests then can be executed through `unit_tests` test
219-
executable that is built during compilation.
241+
This option is disabled by default. It enables compilation of a separate
242+
shared library (liblog4cplusqt5debugappender) that implements
243+
`Qt5DebugAppender`. It requires Qt5 and pkg-config to be available.
220244

221245

222246
Notes
@@ -610,8 +634,8 @@ Unsupported compilers and platforms
610634
-----------------------------------
611635

612636
[log4cplus] does not support too old or broken C++ compilers. Since [log4cplus]
613-
version 2.0.0, it means it does not support any platform or compiler without
614-
decent C++11 support.
637+
version 3.0.0, it means it does not support any platform or compiler without
638+
decent C++17 support.
615639

616640
- Visual Studio prior to 2015
617641
- GCC prior to 4.8

configure

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12332,6 +12332,19 @@ fi
1233212332
done
1233312333

1233412334

12335+
for ac_func in accept4
12336+
do :
12337+
ac_fn_cxx_check_func "$LINENO" "accept4" "ac_cv_func_accept4"
12338+
if test "x$ac_cv_func_accept4" = xyes; then :
12339+
cat >>confdefs.h <<_ACEOF
12340+
#define HAVE_ACCEPT4 1
12341+
_ACEOF
12342+
$as_echo "#define LOG4CPLUS_HAVE_ACCEPT4 1" >>confdefs.h
12343+
12344+
fi
12345+
done
12346+
12347+
1233512348
for ac_func in ftime
1233612349
do :
1233712350
ac_fn_cxx_check_func "$LINENO" "ftime" "ac_cv_func_ftime"

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ LOG4CPLUS_CHECK_FUNCS([getpid], [LOG4CPLUS_HAVE_GETPID])
548548
LOG4CPLUS_CHECK_FUNCS([poll], [LOG4CPLUS_HAVE_POLL])
549549
LOG4CPLUS_CHECK_FUNCS([pipe], [LOG4CPLUS_HAVE_PIPE])
550550
LOG4CPLUS_CHECK_FUNCS([pipe2], [LOG4CPLUS_HAVE_PIPE2])
551+
LOG4CPLUS_CHECK_FUNCS([accept4], [LOG4CPLUS_HAVE_ACCEPT4])
551552
LOG4CPLUS_CHECK_FUNCS([ftime], [LOG4CPLUS_HAVE_FTIME])
552553
LOG4CPLUS_CHECK_FUNCS([stat], [LOG4CPLUS_HAVE_STAT])
553554
LOG4CPLUS_CHECK_FUNCS([lstat], [LOG4CPLUS_HAVE_LSTAT])

docs/latex-header.tex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
%% latex-header.tex begin
33
%%
44

5-
\usepackage{fix-cm}
65
\usepackage{graphicx}
76
\usepackage{epstopdf}
87
\usepackage{anyfontsize}
@@ -16,15 +15,15 @@
1615
\usepackage{upquote}
1716
\usepackage{etoolbox}
1817

19-
\setmainfont[Ligatures={TeX, Common}]{TeX Gyre Pagella}
20-
\setmonofont[Scale=MatchLowercase,Ligatures={NoCommon}]{DejaVu Sans Mono}
18+
%\setmainfont[Ligatures={TeX, Common}]{TeX Gyre Pagella}
19+
%\setmonofont[Scale=MatchLowercase,Ligatures={NoCommon}]{DejaVu Sans Mono}
2120
%\setromanfont{Georgia}
2221
%\setsansfont{DejaVu Sans}
2322

24-
\newfontfamily{\cjkfont}{WenQuanYi Zen Hei}[]
25-
\newfontfamily{\devanagarifont}{Lohit Devanagari}[]
26-
\newfontfamily{\tamilfont}{Lohit Tamil}[]
27-
\newfontfamily{\cyrilicfont}{CMU Serif}
23+
\newfontfamily\cjkfont{WenQuanYi Zen Hei}[]
24+
\newfontfamily\devanagarifont{Noto Serif Devanagari}[]
25+
\newfontfamily\tamilfont{Noto Serif Tamil}[]
26+
\newfontfamily\cyrilicfont{PTSerif}[]
2827

2928
%% These unfortunately break too many things. PDF will have to be without
3029
%% contributors' native names.

docs/release.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@ revision, yet._
1515

1616
#. Send announcement to <[email protected]>.
1717

18-
#. Tag revision on branch.
18+
#. Tag revision on branch. _Do not forget to push the tag._
1919

2020
#. Write [news entry][2] to SourceForge.
2121

22-
#. Use Pandoc with parameters `--standalone -f markdown+smart -t
23-
markdown_strict+hard_line_breaks+fenced_code_blocks+fenced_code_attributes-intraword_underscores`
24-
to generate a version of README file with Markdown compatible with
25-
SourceForge's wiki. Upload resulting file to project's SourceForge wiki page
26-
using the `scripts/upload_to_wiki.pl` script.
22+
#. Use Pandoc with parameters
2723

28-
#. Post release information to [G+ log4cplus page][1] and share it with the
29-
[log4cplus community][3].
24+
```
25+
--standalone -f markdown+smart -t markdown_strict+hard_line_breaks+fenced_code_blocks+fenced_code_attributes-intraword_underscores
26+
```
27+
28+
to generate a version of README file with Markdown compatible with
29+
SourceForge's wiki. Upload resulting file to project's SourceForge wiki
30+
page using the `scripts/upload_to_wiki.pl` script.
3031

31-
[1]: https://plus.google.com/u/0/b/111599007078013023156/
3232
[2]: https://sourceforge.net/p/log4cplus/news/new
33-
[3]: https://plus.google.com/u/0/b/111599007078013023156/communities/117815353450765593933
3433
[4]: https://sourceforge.net/projects/log4cplus/files/

include/log4cplus/config/defines.hxx.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
/* */
119119
#undef LOG4CPLUS_HAVE_PIPE2
120120

121+
/* */
122+
#undef LOG4CPLUS_HAVE_ACCEPT4
123+
121124
/* */
122125
#undef LOG4CPLUS_HAVE_POLL
123126

scripts/build-pdf.pl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,30 @@
2222
, 'LICENSE' );
2323

2424
my @PANDOC_1ST_STEP_SWITCHES =
25-
( '--smart'
26-
, '--self-contained'
27-
, '--normalize'
25+
( '--self-contained'
2826
, '--atx-headers'
29-
, '-f', 'markdown'
27+
, '-f', 'markdown+smart'
3028
, '-t', 'markdown' );
3129

3230
my @PANDOC_2ND_STEP_SWITCHES =
33-
( '--smart'
34-
, '--self-contained'
31+
( '--self-contained'
3532
, '--toc'
3633
, '--number-sections'
3734
# Qt4 / Win32 / MSVC has example that breaks listings on some versions of
3835
# TeXLive
3936
, '--listings'
40-
, '-f', 'markdown'
37+
, '-f', 'markdown+smart'
4138
, '-t', 'latex',
42-
, '--latex-engine=lualatex',
39+
, '--pdf-engine=lualatex',
4340
, '--include-in-header=docs/latex-header.tex'
4441
, '--include-before-body=docs/latex-body.tex'
45-
, '-V', 'lang=en-US',
46-
, '-V', 'geometry:a4paper');
42+
, '-V', 'lang:en-US',
43+
, '-V', 'geometry:a4paper'
44+
, '-V', 'mainfont:TeX Gyre Pagella'
45+
, '-V', 'mainfontoptions:Ligatures={TeX, Common}'
46+
, '-V', 'monofont:DejaVu Sans Mono'
47+
, '-V', 'monofontoptions:Ligatures={}'
48+
);
4749

4850
# pre-compute various source information strings
4951

@@ -125,10 +127,10 @@
125127
my $devanagariCodePoint = qr/[\p{Devanagari}]/u;
126128
my $tamilCodePoint = qr/[\p{Tamil}]/u;
127129
my $cyrilicCodePoint = qr/[\p{InCyrillic}\p{InCyrillicSupplementary}]/u;
128-
$contents =~ s/(${cjkCodePoint}+)/{\\cjkfont{}$1}/g;
129-
$contents =~ s/(${devanagariCodePoint}+)/{\\devanagarifont{}$1}/g;
130-
$contents =~ s/(${tamilCodePoint}+)/{\\tamilfont{}$1}/g;
131-
$contents =~ s/(${cyrilicCodePoint}+)/{\\cyrilicfont{}$1}/g;
130+
$contents =~ s/(${cjkCodePoint}+(?:[\s\h\p{Zs}\p{Po}]+${cjkCodePoint}+)?)/{\\cjkfont{}$1}/gu;
131+
$contents =~ s/(${devanagariCodePoint}+(?:[\s\h\p{Zs}\p{Po}]+${devanagariCodePoint}+)?)/{\\devanagarifont{}$1}/gu;
132+
$contents =~ s/(${tamilCodePoint}+(?:[\s\h\p{Zs}\p{Po}]+${tamilCodePoint}+)?)/{\\tamilfont{}$1}/gu;
133+
$contents =~ s/(${cyrilicCodePoint}+(?:[\s\h\p{Zs}\p{Po}]+${cyrilicCodePoint}+)?)/{\\cyrilicfont{}$1}/gu;
132134
use constant README_MD_TEX => 'README.md.tex';
133135
write_file(README_MD_TEX, {binmode => ':utf8'}, $contents);
134136

src/socket-unix.cxx

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,32 @@ accept_wrap (
287287
return result;
288288
}
289289

290+
// Overload for `accept4()`.
291+
template <typename accept_sockaddr_ptr_type, typename accept_socklen_type>
292+
static
293+
SOCKET_TYPE
294+
accept_wrap (
295+
int (* accept_func) (int, accept_sockaddr_ptr_type, accept_socklen_type *,
296+
int),
297+
SOCKET_TYPE sock, struct sockaddr * sa, socklen_t * len)
298+
{
299+
typedef typename socklen_var<accept_socklen_type, socklen_t>::type
300+
socklen_var_type;
301+
socklen_var_type l = static_cast<socklen_var_type>(*len);
302+
SOCKET_TYPE result
303+
= static_cast<SOCKET_TYPE>(
304+
accept_func (sock, sa,
305+
reinterpret_cast<accept_socklen_type *>(&l),
306+
#if defined (SOCK_CLOEXEC)
307+
SOCK_CLOEXEC
308+
#else
309+
0
310+
#endif
311+
));
312+
*len = static_cast<socklen_t>(l);
313+
return result;
314+
}
315+
290316

291317
} // namespace
292318

@@ -299,7 +325,13 @@ acceptSocket(SOCKET_TYPE sock, SocketState& state)
299325
int clientSock;
300326

301327
while(
302-
(clientSock = accept_wrap (accept, to_os_socket (sock),
328+
(clientSock = accept_wrap (
329+
#if defined (LOG4CPLUS_HAVE_ACCEPT4)
330+
accept4
331+
#else
332+
accept
333+
#endif
334+
, to_os_socket (sock),
303335
reinterpret_cast<struct sockaddr*>(&net_client), &len))
304336
== -1
305337
&& (errno == EINTR))

0 commit comments

Comments
 (0)