/*
 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 *        FILE:	time2.h
 *     PURPOSE:	To redirect the C-Runtime Library 'time()' call to
 *		a work-around function 'want_time()'.
 *  CHANGE LOG:
 *
 * Date	    Name	Change Description				SPR #
 * -------- -------	-----------------------------------------------	--------
 * 30MAR99  KNC		Initial Delivery				SPR 8649
 *
 *	 NOTES:
 *
 * SPR 8649: time() returns invalid GMT after TimeZone change
 *
 * This file contains a work-around to a problem discovered in
 * The Microsoft C-Runtime Library time() function. Until Microsoft
 * provides a fix, this function will be compiled into FLIB to
 * override the broken version.
 *
 * This file was included by FLINK/src/inc/flibnt.h, this allows the
 * fix to reach the majority of the necessary files. The files which
 * need this fix, but do not include flib.h must include this file
 * directly. When linking, the task must link with FLIB or TIME2.OBJ.
 *
 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 */
#ifndef _TIME2_H_
#define _TIME2_H_

/*SPR 8649*/ /* Workaround for NT's broken time() function	*/

/* Until Microsoft fixes their C-RunTime (CRT) library bug,	*/
/* the USDATA time-fix must be ENABLED.				*/
#define  _ENABLE_CRT_TIME_FIX_

#ifdef   _ENABLE_CRT_TIME_FIX_
#  include <time.h>
#  ifndef FLENTRY
#    define FLENTRY	/* Avoid problems when this is undefined	*/
#  endif /* FLENTRY */

#  ifdef __cplusplus
extern "C" {
#  endif
	extern    time_t  FLENTRY want_time(time_t*);		/*SPR 8649*/
#  ifdef __cplusplus
}
#  endif

#  define time(_t)	want_time(_t)				/*SPR 8649*/
#endif  /* _ENABLE_CRT_TIME_FIX_ */

#endif /* _TIME2_H_ */
