Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::signal() has a fixed signature since C++03 #52

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ else()
set(HAVE_BSD_SIGNALS 0)
endif()

# =============================================================================
# Set return type of signal in RETSIGTYPE
# =============================================================================
iv_check_signal_return_type(RETSIGTYPE)

# =============================================================================
# Generate config.h after all checks
# =============================================================================
Expand Down
22 changes: 0 additions & 22 deletions cmake/HelperFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,3 @@ function(iv_check_type_exists HEADER TYPE DEFAULT_TYPE VARIABLE)
endif()
file(REMOVE "conftest.c")
endfunction()

# =============================================================================
# Check return type of signal
# =============================================================================
function(iv_check_signal_return_type VARIABLE)
# code template to check signal support
set(CONFTEST_RETSIGTYPE "
#include <sys/types.h>
#include <signal.h>

int main () {
return *(signal (0, 0)) (0) == 1;
}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/conftest.c ${CONFTEST_RETSIGTYPE})
try_compile(RESULT_VAR ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/conftest.c)
if(${RESULT_VAR})
set(${VARIABLE} int PARENT_SCOPE)
else()
set(${VARIABLE} void PARENT_SCOPE)
endif()
file(REMOVE "conftest.c")
endfunction()
3 changes: 0 additions & 3 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@
/* define if stream.h is insufficient by itself */
#cmakedefine NO_OUTPUT_OPENMODE

/* Define as the return type of signal handlers (`int' or `void'). */
#cmakedefine RETSIGTYPE @RETSIGTYPE@

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

Expand Down
17 changes: 2 additions & 15 deletions src/include/Dispatch/dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,10 @@ class Dispatcher {
TimerQueue* _queue;
ChildQueue* _cqueue;

#if defined(HAVE_BSD_SIGNALS) || defined(HAVE_POSIX_SIGNALS)
static RETSIGTYPE sigCLD(int);
#else // When is this used?
static RETSIGTYPE sigCLD(...);
#endif
//#if defined(sgi)
// static void sigCLD(...);
//#else
//#if defined(AIXV4)
// static void sigCLD(int);
//#else
// static void sigCLD();
//#endif
//#endif
static void sigCLD(int);
private:
static Dispatcher* _instance;
private:

/* deny access since member-wise won't work */
Dispatcher(const Dispatcher&);
Dispatcher& operator =(const Dispatcher&);
Expand Down
17 changes: 1 addition & 16 deletions src/lib/Dispatch/dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,16 +619,6 @@ int Dispatcher::fillInReady(
return rmaskret.numSet() + wmaskret.numSet() + emaskret.numSet();
}

//#if defined(sgi)
//void Dispatcher::sigCLD(...) {
//#else
//#if defined(AIXV4)
//void Dispatcher::sigCLD(int) {
//#else
//void Dispatcher::sigCLD() {
//#endif
//#endif

//
// From what I can see from other packages that have been ported to a lot
// of systems, it looks like you can get away with declaring your signal
Expand All @@ -637,12 +627,7 @@ int Dispatcher::fillInReady(
// The actual type could be guessed by autoconf, I suppose, if it's
// worth it to devise a test.
//
RETSIGTYPE
#if defined(HAVE_BSD_SIGNALS) || defined(HAVE_POSIX_SIGNALS)
Dispatcher::sigCLD(int)
#else // When is this used?
Dispatcher::sigCLD(...)
#endif
void Dispatcher::sigCLD(int)
{
pid_t pid;
int status;
Expand Down
Loading