Navigation


Changeset 836:da97a5aa7976 in freeDiameter for include


Ignore:
Timestamp:
Oct 10, 2012, 8:34:30 PM (12 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Add replacement for clock_gettime (for Mac OS) -- ticket #38

Location:
include/freeDiameter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/CMakeLists.txt

    r815 r836  
    7272
    7373# clock_gettime
    74 CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME)
    75 IF (HAVE_CLOCK_GETTIME)
     74SET(HAVE_CLOCK_GETTIME "")
     75CHECK_FUNCTION_EXISTS (clock_gettime HAVE_NATIVE_CLOCK_GETTIME)
     76IF (HAVE_NATIVE_CLOCK_GETTIME)
    7677   SET(CLOCK_GETTIME_LIBS "")
    77 ELSE (HAVE_CLOCK_GETTIME)
     78   SET(HAVE_CLOCK_GETTIME 1)
     79ELSE (HAVE_NATIVE_CLOCK_GETTIME)
    7880   CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT)
    7981   IF (HAVE_LIBRT)
    8082     SET(CLOCK_GETTIME_LIBS "-lrt")
     83     SET(HAVE_CLOCK_GETTIME 1)
    8184   ELSE (HAVE_LIBRT)
    8285     CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" HAVE_LIBPOSIX4)
    8386     IF (HAVE_LIBPOSIX4)
    8487       SET(CLOCK_GETTIME_LIBS "-lposix4")
     88       SET(HAVE_CLOCK_GETTIME 1)
    8589     ENDIF (HAVE_LIBPOSIX4)
    8690   ENDIF (HAVE_LIBRT)
    87 ENDIF (HAVE_CLOCK_GETTIME)
     91ENDIF (HAVE_NATIVE_CLOCK_GETTIME)
    8892SET(CLOCK_GETTIME_LIBS ${CLOCK_GETTIME_LIBS} PARENT_SCOPE)
    8993
  • include/freeDiameter/freeDiameter-host.h.in

    r815 r836  
    4242#cmakedefine HAVE_SIGNALENT_H
    4343#cmakedefine HAVE_AI_ADDRCONFIG
     44#cmakedefine HAVE_CLOCK_GETTIME
    4445
    4546#cmakedefine HOST_BIG_ENDIAN @HOST_BIG_ENDIAN@
  • include/freeDiameter/libfdproto.h

    r810 r836  
    604604
    605605/*============================================================*/
     606/*                         PORTABILITY                        */
     607/*============================================================*/
     608#ifndef HAVE_CLOCK_GETTIME
     609  #define CLOCK_REALTIME  0
     610  #include <sys/time.h>
     611  int clock_gettime(int clk_id, struct timespec* ts);
     612#endif /* HAVE_CLOCK_GETTIME */
     613
     614
     615
     616/*============================================================*/
    606617/*                         BINARY STRINGS                     */
    607618/*============================================================*/
Note: See TracChangeset for help on using the changeset viewer.