Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ademco_hb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
ademco_hb
Commits
0e8f3d9a
Commit
0e8f3d9a
authored
4 years ago
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e9182818
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
build.sh
examples/build.sh
+10
-1
server_demo_libevent.cpp
examples/server_demo_libevent/server_demo_libevent.cpp
+3
-9
No files found.
examples/build.sh
View file @
0e8f3d9a
...
...
@@ -2,11 +2,20 @@
mkdir
-p
build
cd
build
opt
=
"-std=c++11 -O3"
eb
=
0
if
[
x
$1
!=
x
]
;
then
if
[
$1
-eq
1
]
;
then
eb
=
1
fi
fi
g++
$opt
../bench/bench.cpp
-I
../../include
-o
bench
g++
$opt
../demo/demo.cpp
-I
../../include
-o
demo
g++
$opt
../server_demo/server_demo.cpp
-I
../../include
-lpthread
-o
server_demo
g++
-std
=
c++11
-O3
-DNDEBUG
-DENABLE_BREAKPAD
=
$
1
-g
-gdwarf
../server_demo_libevent/server_demo_libevent.cpp
-I
../../include
`
pkg-config
--cflags
--libs
libevent breakpad
`
-levent_core
-levent_pthreads
-lpthread
-lbreakpad_client
-o
server_demo_libevent
g++
-std
=
c++11
-O3
-DNDEBUG
-DENABLE_BREAKPAD
=
$
eb
-g
-gdwarf
../server_demo_libevent/server_demo_libevent.cpp
-I
../../include
`
pkg-config
--cflags
--libs
libevent breakpad
`
-levent_core
-levent_pthreads
-lpthread
-lbreakpad_client
-o
server_demo_libevent
g++
$opt
../bench_client/bench_client.cpp
-I
../../include
`
pkg-config
--cflags
--libs
libevent
`
-levent_core
-levent_pthreads
-lpthread
-o
bench_client
This diff is collapsed.
Click to expand it.
examples/server_demo_libevent/server_demo_libevent.cpp
View file @
0e8f3d9a
...
...
@@ -28,8 +28,7 @@
#include <event2/bufferevent.h>
#include <event2/thread.h>
#ifdef ENABLE_BREAKPAD
#if (ENABLE_BREAKPAD==1)
#if ENABLE_BREAKPAD
#ifdef _WIN32
#include <client/windows/handler/exception_handler.h>
static
bool
dumpCallback
(
const
wchar_t
*
dump_path
,
...
...
@@ -53,7 +52,6 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
}
#endif
#endif
#endif
#define DISABLE_JLIB_LOG2
...
...
@@ -387,8 +385,7 @@ int main(int argc, char** argv)
fprintf
(
stderr
,
"failed to init libevent with thread by calling evthread_use_windows_threads
\n
"
);
return
-
1
;
}
#ifdef ENABLE_BREAKPAD
#if (ENABLE_BREAKPAD==1)
#if ENABLE_BREAKPAD
google_breakpad
::
ExceptionHandler
eh
(
L"./"
,
// dump_path
nullptr
,
// FilterCallback
dumpCallback
,
// MinidumpCallback
...
...
@@ -396,17 +393,14 @@ int main(int argc, char** argv)
google_breakpad
::
ExceptionHandler
::
HANDLER_ALL
// handler_types
);
// MINIDUMP_TYPE
#endif
#endif
#else
if
(
0
!=
evthread_use_pthreads
())
{
fprintf
(
stderr
,
"failed to init libevent with thread by calling evthread_use_pthreads
\n
"
);
return
-
1
;
}
#ifdef ENABLE_BREAKPAD
#if (ENABLE_BREAKPAD==1)
#if ENABLE_BREAKPAD
google_breakpad
::
ExceptionHandler
eh
(
google_breakpad
::
MinidumpDescriptor
(
"./"
),
nullptr
,
dumpCallback
,
nullptr
,
true
,
-
1
);
#endif
#endif
#endif
int
port
=
12345
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment