ObjFW  Check-in [4ec0948b1b]

Overview
Comment:Properly check for sys/types.h
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4ec0948b1bd8117618637cc1e59f4cf803a393a302063a9b1fd742bac85151e9
User & Date: js on 2017-06-03 18:37:19
Other Links: manifest | tags
Context
2017-06-03
18:41
ofhttp: Small string fix check-in: cead04ef07 user: js tags: trunk
18:37
Properly check for sys/types.h check-in: 4ec0948b1b user: js tags: trunk
16:58
Make sockets work on MorphOS + libnix check-in: 3cba61d694 user: js tags: trunk
Changes

Modified configure.ac from [5c29d3ac98] to [16ece0f5c7].

488
489
490
491
492
493
494



495
496
497
498
499
500
501
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)
	AC_DEFINE(SSIZE_MAX, [((ssize_t)(SIZE_MAX / 2))],
		[Maximum value for ssize_t])
])




AC_CHECK_TYPE(max_align_t,
	[AC_DEFINE(OF_HAVE_MAX_ALIGN_T, 1, [Whether we have max_align_t])])

AC_CHECK_HEADER(stdnoreturn.h,
	[AC_DEFINE(OF_HAVE_STDNORETURN_H, 1, [Whether we have stdnoreturn.h])])

AC_CHECK_TYPE(wchar_t)







>
>
>







488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)
	AC_DEFINE(SSIZE_MAX, [((ssize_t)(SIZE_MAX / 2))],
		[Maximum value for ssize_t])
])

AC_CHECK_HEADER(sys/types.h,
	[AC_DEFINE(OF_HAVE_SYS_TYPES_H, 1, [Whether we have <sys/types.h>])])

AC_CHECK_TYPE(max_align_t,
	[AC_DEFINE(OF_HAVE_MAX_ALIGN_T, 1, [Whether we have max_align_t])])

AC_CHECK_HEADER(stdnoreturn.h,
	[AC_DEFINE(OF_HAVE_STDNORETURN_H, 1, [Whether we have stdnoreturn.h])])

AC_CHECK_TYPE(wchar_t)
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
			])
			;;
	esac

	AC_MSG_CHECKING(for getaddrinfo)
	AC_TRY_COMPILE([
		#include <stddef.h>
		#ifndef _WIN32
		# include <sys/types.h>
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include <sys/socket.h>
		#endif
		#ifdef HAVE_NETDB_H
		# include <netdb.h>







|







1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
			])
			;;
	esac

	AC_MSG_CHECKING(for getaddrinfo)
	AC_TRY_COMPILE([
		#include <stddef.h>
		#ifdef OF_HAVE_SYS_TYPES_H
		# include <sys/types.h>
		#endif
		#ifdef HAVE_SYS_SOCKET_H
		# include <sys/socket.h>
		#endif
		#ifdef HAVE_NETDB_H
		# include <netdb.h>
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
					have_threadsafe_getaddrinfo="unknown"
					;;
			esac

			AS_IF([test x"$have_threadsafe_getaddrinfo" = \
					x"unknown"], [
				AC_EGREP_CPP(yes, [
					#ifndef _WIN32
					# include <sys/types.h>
					#endif
					#ifdef HAVE_SYS_SOCKET_H
					# include <sys/socket.h>
					#endif
					#ifdef HAVE_NETDB_H
					# include <netdb.h>







|







1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
					have_threadsafe_getaddrinfo="unknown"
					;;
			esac

			AS_IF([test x"$have_threadsafe_getaddrinfo" = \
					x"unknown"], [
				AC_EGREP_CPP(yes, [
					#ifdef OF_HAVE_SYS_TYPES_H
					# include <sys/types.h>
					#endif
					#ifdef HAVE_SYS_SOCKET_H
					# include <sys/socket.h>
					#endif
					#ifdef HAVE_NETDB_H
					# include <netdb.h>

Modified src/OFMutableString.m from [f5a01a1e43] to [b2395b2e90].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#include <sys/types.h>

#import "OFString.h"
#import "OFMutableString_UTF8.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"








<
<







16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>



#import "OFString.h"
#import "OFMutableString_UTF8.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"

Modified src/OFNumber.h from [d2e9d52654] to [b4280b6f63].

17
18
19
20
21
22
23



24

25
26
27
28
29
30
31
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif




#include <sys/types.h>


#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN







>
>
>
|
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include "objfw-defs.h"

#ifdef OF_HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"
#import "OFMessagePackRepresentation.h"

OF_ASSUME_NONNULL_BEGIN

Modified src/OFProcess.h from [f549c80d9c] to [b8f13557bc].

17
18
19
20
21
22
23



24

25
26
27
28
29
30
31
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif




#include <sys/types.h>


#import "OFStream.h"
#import "OFString.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif







>
>
>
|
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include "objfw-defs.h"

#ifdef OF_HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#import "OFStream.h"
#import "OFString.h"

#ifdef OF_WINDOWS
# include <windows.h>
#endif

Modified src/OFSeekableStream.h from [8acc79141d] to [6b187920bd].

17
18
19
20
21
22
23



24

25
26
27
28
29
30
31
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif




#include <sys/types.h>


#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

#if defined(OF_WINDOWS)
typedef __int64 of_offset_t;







>
>
>
|
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include "objfw-defs.h"

#ifdef OF_HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#import "OFStream.h"

OF_ASSUME_NONNULL_BEGIN

#if defined(OF_WINDOWS)
typedef __int64 of_offset_t;

Modified src/OFString_UTF8.m from [2b39181352] to [62af83b584].

16
17
18
19
20
21
22

23

24
25
26
27
28
29
30

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>


#include <sys/types.h>


#import "OFString_UTF8.h"
#import "OFString_UTF8+Private.h"
#import "OFMutableString_UTF8.h"
#import "OFArray.h"

#import "OFInitializationFailedException.h"







>
|
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#include "config.h"

#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#ifdef OF_HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#import "OFString_UTF8.h"
#import "OFString_UTF8+Private.h"
#import "OFMutableString_UTF8.h"
#import "OFArray.h"

#import "OFInitializationFailedException.h"

Modified src/OFXMLParser.m from [9b8cdb5bf4] to [b19418ed62].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#include "config.h"

#include <string.h>

#include <sys/types.h>

#import "OFXMLParser.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFBigDataArray.h"
#import "OFXMLAttribute.h"
#import "OFStream.h"







<
<







14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#include "config.h"

#include <string.h>



#import "OFXMLParser.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFBigDataArray.h"
#import "OFXMLAttribute.h"
#import "OFStream.h"
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
	OFDictionary *const *objects = [namespaces objects];
	size_t count = [namespaces count];

	if (prefix == nil)
		prefix = @"";

	if (count - 1 > SSIZE_MAX)
		@throw [OFOutOfRangeException exception];

	for (ssize_t i = count - 1; i >= 0; i--) {
		OFString *tmp;

		if ((tmp = [objects[i] objectForKey: prefix]) != nil)
			return tmp;
	}

	return nil;
}

static OF_INLINE void







|
<
<
<


|







101
102
103
104
105
106
107
108



109
110
111
112
113
114
115
116
117
118
{
	OFDictionary *const *objects = [namespaces objects];
	size_t count = [namespaces count];

	if (prefix == nil)
		prefix = @"";

	while (count > 0) {



		OFString *tmp;

		if ((tmp = [objects[--count] objectForKey: prefix]) != nil)
			return tmp;
	}

	return nil;
}

static OF_INLINE void

Modified src/objfw-defs.h.in from [095ccff6f0] to [5fe4b33996].

26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
#undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES
#undef OF_HAVE_SCHED_YIELD
#undef OF_HAVE_SOCKETS
#undef OF_HAVE_STDNORETURN
#undef OF_HAVE_SYMLINK
#undef OF_HAVE_SYNC_BUILTINS
#undef OF_HAVE_SYS_SOCKET_H

#undef OF_HAVE_THREADS
#undef OF_HAVE_UNICODE_TABLES
#undef OF_HAVE__THREAD_LOCAL
#undef OF_HAVE___THREAD
#undef OF_NINTENDO_DS
#undef OF_OBJFW_RUNTIME
#undef OF_UNIVERSAL
#undef SIZE_MAX







>








26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES
#undef OF_HAVE_SCHED_YIELD
#undef OF_HAVE_SOCKETS
#undef OF_HAVE_STDNORETURN
#undef OF_HAVE_SYMLINK
#undef OF_HAVE_SYNC_BUILTINS
#undef OF_HAVE_SYS_SOCKET_H
#undef OF_HAVE_SYS_TYPES_H
#undef OF_HAVE_THREADS
#undef OF_HAVE_UNICODE_TABLES
#undef OF_HAVE__THREAD_LOCAL
#undef OF_HAVE___THREAD
#undef OF_NINTENDO_DS
#undef OF_OBJFW_RUNTIME
#undef OF_UNIVERSAL
#undef SIZE_MAX

Modified src/of_asprintf.m from [dfdbe062d8] to [3e2fecec3f].

29
30
31
32
33
34
35

36

37
38
39
40
41
42
43
#ifdef HAVE_ASPRINTF_L
# include <locale.h>
#endif
#ifdef HAVE_XLOCALE_H
# include <xlocale.h>
#endif


#include <sys/types.h>


#import "OFString.h"
#import "OFLocalization.h"

#import "OFInitializationFailedException.h"

#define MAX_SUBFORMAT_LEN 64







>
|
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifdef HAVE_ASPRINTF_L
# include <locale.h>
#endif
#ifdef HAVE_XLOCALE_H
# include <xlocale.h>
#endif

#ifdef OF_HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#import "OFString.h"
#import "OFLocalization.h"

#import "OFInitializationFailedException.h"

#define MAX_SUBFORMAT_LEN 64