ObjFW  Check-in [5f897cae6d]

Overview
Comment:Fix build on Windows
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5f897cae6df3c0fc62aee0ed7e1948012abdc68fc68da2a410eb8a787d0859e4
User & Date: js on 2023-08-25 17:02:05
Other Links: manifest | tags
Context
2023-08-25
23:32
Fix nullability issues found by clang-analyzer check-in: d93bcda0b2 user: js tags: trunk
17:02
Fix build on Windows check-in: 5f897cae6d user: js tags: trunk
14:19
Remove unused variables check-in: 6ebaa2d2f5 user: js tags: trunk
Changes

Modified src/OFDate.m from [d12ca09b85] to [8868a82344].

655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
- (OFString *)dateStringWithFormat: (OFConstantString *)format
{
	OFString *ret;
	OFTimeInterval timeInterval = self.timeIntervalSince1970;
	time_t seconds = (time_t)timeInterval;
	struct tm tm;
	size_t pageSize;
#ifndef OF_WINDOWS
	char *buffer;
#else
	wchar_t *buffer;
#endif

	if (seconds != trunc(timeInterval))
		@throw [OFOutOfRangeException exception];

#ifdef HAVE_GMTIME_R
	if (gmtime_r(&seconds, &tm) == NULL)
		@throw [OFOutOfRangeException exception];







<

<
<
<







655
656
657
658
659
660
661

662



663
664
665
666
667
668
669
- (OFString *)dateStringWithFormat: (OFConstantString *)format
{
	OFString *ret;
	OFTimeInterval timeInterval = self.timeIntervalSince1970;
	time_t seconds = (time_t)timeInterval;
	struct tm tm;
	size_t pageSize;

	char *buffer;




	if (seconds != trunc(timeInterval))
		@throw [OFOutOfRangeException exception];

#ifdef HAVE_GMTIME_R
	if (gmtime_r(&seconds, &tm) == NULL)
		@throw [OFOutOfRangeException exception];
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
- (OFString *)localDateStringWithFormat: (OFConstantString *)format
{
	OFString *ret;
	OFTimeInterval timeInterval = self.timeIntervalSince1970;
	time_t seconds = (time_t)timeInterval;
	struct tm tm;
	size_t pageSize;
#ifndef OF_WINDOWS
	char *buffer;
#else
	wchar_t *buffer;
#endif

	if (seconds != trunc(timeInterval))
		@throw [OFOutOfRangeException exception];

#ifdef HAVE_LOCALTIME_R
	if (localtime_r(&seconds, &tm) == NULL)
		@throw [OFOutOfRangeException exception];







<

<
<
<







704
705
706
707
708
709
710

711



712
713
714
715
716
717
718
- (OFString *)localDateStringWithFormat: (OFConstantString *)format
{
	OFString *ret;
	OFTimeInterval timeInterval = self.timeIntervalSince1970;
	time_t seconds = (time_t)timeInterval;
	struct tm tm;
	size_t pageSize;

	char *buffer;




	if (seconds != trunc(timeInterval))
		@throw [OFOutOfRangeException exception];

#ifdef HAVE_LOCALTIME_R
	if (localtime_r(&seconds, &tm) == NULL)
		@throw [OFOutOfRangeException exception];