fix: enable building without threads (#964)

This commit is contained in:
Sergiu Deitsch 2023-10-06 22:30:31 +02:00 committed by GitHub
parent 747b8a0774
commit 1dffb4eb29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -468,6 +468,7 @@ set (GLOG_SRCS
src/demangle.h
src/logging.cc
src/raw_logging.cc
src/signalhandler.cc
src/symbolize.cc
src/symbolize.h
src/utilities.cc
@ -475,10 +476,6 @@ set (GLOG_SRCS
src/vlog_is_on.cc
)
if (HAVE_PTHREAD OR WIN32 OR CYGWIN)
list (APPEND GLOG_SRCS src/signalhandler.cc)
endif (HAVE_PTHREAD OR WIN32 OR CYGWIN)
if (CYGWIN OR WIN32)
list (APPEND GLOG_SRCS
src/windows/port.cc

View File

@ -595,7 +595,8 @@ class Thread {
void Start() { pthread_create(&th_, nullptr, &Thread::InvokeThread, this); }
void Join() { pthread_join(th_, nullptr); }
#else
# error No thread implementation.
void Start() {}
void Join() {}
#endif
protected:
@ -614,7 +615,7 @@ class Thread {
}
HANDLE handle_;
DWORD th_;
#else
#elif defined(HAVE_PTHREAD)
pthread_t th_;
#endif
};