[ntp:questions] NTP & PPS, part 2 ;)

E-Mail Sent to this address will be added to the BlackLists Null at BlackList.Anitech-Systems.invalid
Thu Dec 18 20:55:18 UTC 2014


Rob wrote:> Martin Burnicki wrote:
>> Without having looked at the code base, I'm sure there are already
>> predefined macros available for the current build target/architecture.
>>
>> So it should not be a problem to include something like
>>
>> #if defined( SOLARIS )
>>   #include <timepps_solaris.h>
>> #elif defined ( SCO )
>>   #include <timepps_sco.h>
>> #elif defined ( LINUX ) || defined( FREEBSD )
>>   #include <timepps.h>
>> #endif
>>
>> If this piece of code is required more than once it should be put into a
>> common header file which is included in all places where this is
>> required. No duplicate code.
>
> The above is already there in the code, Martin.
> The only point is that these timepps-SunOS.h, timepps-SCO.h and
> timepps-Solaris.h files are included but the Linux version is not.


ntpd/ppsapi_timepps.h
/* ppsapi_timepps.h */

/*
 * This logic first tries to get the timepps.h file from a standard
 * location, and then from our include/ subdirectory.
 */

#ifdef HAVE_TIMEPPS_H
# include <timepps.h>
#else
# ifdef HAVE_SYS_TIMEPPS_H
#  include <sys/timepps.h>
# else
#  ifdef HAVE_CIOGETEV
#   include "timepps-SunOS.h"
#  else
#   ifdef HAVE_TIOCGPPSEV
#    include "timepps-Solaris.h"
#   else
#    ifdef TIOCDCDTIMESTAMP
#     include "timepps-SCO.h"
#    endif
#   endif
#  endif
# endif
#endif


/ntp-dev-4.2.7p464/include
 timepps-SCO.h
 timepps-Solaris.h
 timepps-SunOS.h
 timespecops.h
 timetoa.h
 timevalops.h

/ntp-dev-4.2.7p464/ports/winnt/include
 timepps.h

/ntp-dev-4.2.7p464/ports/winnt/ppsapi/loopback/src
 timepps.h


You are saying you want to add to the source tree ? ; e.g.
/* linuxpps.org/gitweb/?p=pps-tools */
/* http://linuxpps.org/gitweb/?p=pps-tools;a=blob_plain;f=timepps.h;hb=HEAD */
/ntp-dev-4.2.7p464/ports/linux/include
 timepps.h

... and else include reference to it in ppsapi_timepps.h
 at the end of the current include ifdefs ?


-- 
E-Mail Sent to this address <BlackList at Anitech-Systems.com>
  will be added to the BlackLists.



More information about the questions mailing list