Skip to content

Commit

Permalink
std::signal() has a fixed signature since C++03
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino committed Apr 25, 2024
2 parents 949dc5e + bc163f9 commit ad4d922
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 61 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Expand Up @@ -148,11 +148,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
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
Expand Up @@ -74,9 +74,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
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
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

0 comments on commit ad4d922

Please sign in to comment.