Commit 0e8f3d9a authored by captainwong's avatar captainwong

update

parent e9182818
...@@ -2,11 +2,20 @@ ...@@ -2,11 +2,20 @@
mkdir -p build mkdir -p build
cd build cd build
opt="-std=c++11 -O3" 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 ../bench/bench.cpp -I../../include -o bench
g++ $opt ../demo/demo.cpp -I../../include -o demo g++ $opt ../demo/demo.cpp -I../../include -o demo
g++ $opt ../server_demo/server_demo.cpp -I../../include -lpthread -o server_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 g++ $opt ../bench_client/bench_client.cpp -I../../include `pkg-config --cflags --libs libevent` -levent_core -levent_pthreads -lpthread -o bench_client
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
#include <event2/bufferevent.h> #include <event2/bufferevent.h>
#include <event2/thread.h> #include <event2/thread.h>
#ifdef ENABLE_BREAKPAD #if ENABLE_BREAKPAD
#if (ENABLE_BREAKPAD==1)
#ifdef _WIN32 #ifdef _WIN32
#include <client/windows/handler/exception_handler.h> #include <client/windows/handler/exception_handler.h>
static bool dumpCallback(const wchar_t* dump_path, static bool dumpCallback(const wchar_t* dump_path,
...@@ -53,7 +52,6 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, ...@@ -53,7 +52,6 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
} }
#endif #endif
#endif #endif
#endif
#define DISABLE_JLIB_LOG2 #define DISABLE_JLIB_LOG2
...@@ -387,8 +385,7 @@ int main(int argc, char** argv) ...@@ -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"); fprintf(stderr, "failed to init libevent with thread by calling evthread_use_windows_threads\n");
return -1; return -1;
} }
#ifdef ENABLE_BREAKPAD #if ENABLE_BREAKPAD
#if (ENABLE_BREAKPAD==1)
google_breakpad::ExceptionHandler eh(L"./", // dump_path google_breakpad::ExceptionHandler eh(L"./", // dump_path
nullptr, // FilterCallback nullptr, // FilterCallback
dumpCallback, // MinidumpCallback dumpCallback, // MinidumpCallback
...@@ -396,17 +393,14 @@ int main(int argc, char** argv) ...@@ -396,17 +393,14 @@ int main(int argc, char** argv)
google_breakpad::ExceptionHandler::HANDLER_ALL // handler_types google_breakpad::ExceptionHandler::HANDLER_ALL // handler_types
); // MINIDUMP_TYPE ); // MINIDUMP_TYPE
#endif #endif
#endif
#else #else
if (0 != evthread_use_pthreads()) { if (0 != evthread_use_pthreads()) {
fprintf(stderr, "failed to init libevent with thread by calling evthread_use_pthreads\n"); fprintf(stderr, "failed to init libevent with thread by calling evthread_use_pthreads\n");
return -1; return -1;
} }
#ifdef ENABLE_BREAKPAD #if ENABLE_BREAKPAD
#if (ENABLE_BREAKPAD==1)
google_breakpad::ExceptionHandler eh(google_breakpad::MinidumpDescriptor("./"), nullptr, dumpCallback, nullptr, true, -1); google_breakpad::ExceptionHandler eh(google_breakpad::MinidumpDescriptor("./"), nullptr, dumpCallback, nullptr, true, -1);
#endif #endif
#endif
#endif #endif
int port = 12345; int port = 12345;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment