[BACK]Return to test-strptime.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

File: [cvsweb.bsd.lv] / mandoc / test-strptime.c (download)

Revision 1.1, Sun Jul 24 18:15:14 2011 UTC (9 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_3, VERSION_1_12_2, VERSION_1_12_1, VERSION_1_12_0, VERSION_1_11_7, VERSION_1_11_6, VERSION_1_11_5

Scary-looking but otherwise harmless changes allow me to build for Windows.
That is to say, with mingw32.  This amounts to the following:

 (1) break compat.c into compat_strlcpy.c and compat_strlcat.c
 (2) add compat_getsubopt.c (from OpenBSD) and test-getsubopt.c
 (3) add test-strptime.c for HAVE_STRPTIME
 (4) add ifdef bits here and there, where necessary
 (5) remove some harmless unportable stuff (u_char, localtime_r)

I've added the appropriate mdocml.zip target to the Makefile, too.

#if defined(__linux__) || defined(__MINT__)
# define _GNU_SOURCE /* strptime(), getsubopt() */

#include <time.h>

main(int argc, char **argv)
	struct tm tm;
	strptime(*argv, "%D", &tm);
	return 0;