znc/znc — pull request #569 by tpetazzoni (2014-06-10 21:00:45+00:00)
Title: Add missing <time.h> includes

This patch fixes a number of build failures encountered with uClibc
toolchains such as:

Building core object Csocket...
src/Csocket.cpp: In member function 'void CSSockAddr::SinPort(uint16_t)':
src/Csocket.cpp:165:23: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp:165:23: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp:167:21: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp:167:21: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp: In member function 'bool Csock::ConnectInetd(bool, const CString&)':
src/Csocket.cpp:2254:48: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp:2254:48: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp: In member function 'time_t Csock::GetTimeSinceLastDataTransaction(time_t)':
src/Csocket.cpp:2402:41: error: 'time' was not declared in this scope
src/Csocket.cpp: In member function 'time_t Csock::GetNextCheckTimeout(time_t)':
src/Csocket.cpp:2408:21: error: 'time' was not declared in this scope
src/Csocket.cpp: In member function 'virtual bool CSocketManager::Listen(const CSListener&, Csock*, uint16_t*)':
src/Csocket.cpp:2874:18: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
src/Csocket.cpp:2874:18: warning: conversion to 'short unsigned int' from 'unsigned int' may alter its value [-Wconversion]
make[2]: Entering directory `/home/test/test/2/output/build/znc-b396cafdb249544164ed02942a5babba59e519a3/modules'
Building module adminlog...
src/main.cpp: In function 'void seedPRNG()':
src/main.cpp:117:33: error: 'time' was not declared in this scope
src/Csocket.cpp: In member function 'time_t Csock::GetTimeSinceLastDataTransaction(time_t)':
src/Csocket.cpp:2403:1: warning: control reaches end of non-void function [-Wreturn-type]
make[1]: *** [src/Csocket.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Building module alias...
make[1]: *** [src/main.o] Error 1
Building module autoattach...
adminlog.cpp: In member function 'void CAdminLogMod::Log(CString, int)':
adminlog.cpp:94:17: error: 'time' was not declared in this scope
adminlog.cpp:95:33: error: 'localtime' was not declared in this scope
adminlog.cpp:96:60: error: 'strftime' was not declared in this scope
make[2]: *** [adminlog.o] Error 1

These issues are caused by missing includes.

Signed-off-by: Thomas Petazzoni