Index: TODO ================================================================== --- TODO +++ TODO @@ -1,8 +1,8 @@ -OFInteger - +Serialization Tests for OFFile. +Tests for OFNumber. OFBase64 OFDirectory OFDictionary Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -10,10 +10,11 @@ AC_PROG_LN_S AC_PROG_EGREP CFLAGS="$CFLAGS -Wall" OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions" +LIBS="$LIBS -lobjc" AC_DEFINE(OF_CONFIG_H, 1, [Define so that we know we got our config.h]) BUILDSYS_LIB AC_C_BIGENDIAN([AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian])]) @@ -65,13 +66,11 @@ test x"$have_asprintf" != x"yes" -a x"$ac_cv_snprintf_useful_ret" != x"yes" && \ AC_MSG_ERROR(No asprintf and no snprintf returning required space!) ACX_PTHREAD -AC_CHECK_LIB(ws2_32, main, - AC_SUBST(WS2_LIBS, "-lws2_32"), - AC_SUBST(WS2_LIBS, "")) +AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32") AC_MSG_CHECKING(whether we have IPv6 support) AC_CACHE_VAL(ac_cv_have_ipv6, [ AC_TRY_RUN([ #include Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -27,6 +27,5 @@ CPPFLAGS += -I.. ${PTHREAD_CFLAGS} CFLAGS += ${LIB_CFLAGS} OBJCFLAGS += ${LIB_CFLAGS} LD = ${OBJC} LDFLAGS += ${LIB_LDFLAGS} ${PTHREAD_LIBS} -LIBS += -lobjc ${WS2_LIBS} Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -6,10 +6,12 @@ * * This file is part of libobjfw. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ + +#import #import "OFObject.h" enum of_number_type { OF_NUMBER_CHAR, Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -8,10 +8,11 @@ * Q Public License 1.0, which can be found in the file LICENSE included in * the packaging of this file. */ #import +#import #import "OFObject.h" /** * A class for storing and modifying strings. Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -25,10 +25,14 @@ #endif #import "OFString.h" #import "OFExceptions.h" #import "OFMacros.h" + +#ifndef HAVE_ASPRINTF +#import "asprintf.h" +#endif static OF_INLINE int check_utf8(const char *str, size_t len) { size_t i; Index: src/OFTCPSocket.h ================================================================== --- src/OFTCPSocket.h +++ src/OFTCPSocket.h @@ -46,15 +46,10 @@ #endif struct sockaddr *saddr; socklen_t saddr_len; } -/** - * This needs to be called before any socket can be used. - */ -+ (void)startup; - /** * Initializes an already allocated OFTCPSocket. * * \return An initialized OFTCPSocket */ Index: src/OFTCPSocket.m ================================================================== --- src/OFTCPSocket.m +++ src/OFTCPSocket.m @@ -23,19 +23,19 @@ #ifndef INVALID_SOCKET #define INVALID_SOCKET -1 #endif @implementation OFTCPSocket -+ (void)startup -{ #ifdef _WIN32 ++ (void)initialize +{ WSADATA wsa; if (WSAStartup(MAKEWORD(2, 0), &wsa)) @throw [OFInitializationFailedException newWithClass: self]; -#endif } +#endif - init { if ((self = [super init])) { sock = INVALID_SOCKET; Index: tests/OFArray/Makefile ================================================================== --- tests/OFArray/Makefile +++ tests/OFArray/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST} Index: tests/OFHashes/Makefile ================================================================== --- tests/OFHashes/Makefile +++ tests/OFHashes/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST} Index: tests/OFList/Makefile ================================================================== --- tests/OFList/Makefile +++ tests/OFList/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST} Index: tests/OFList/OFList.m ================================================================== --- tests/OFList/OFList.m +++ tests/OFList/OFList.m @@ -9,15 +9,16 @@ * the packaging of this file. */ #import "config.h" -#import #import #import "OFString.h" #import "OFList.h" + +#import #ifndef _WIN32 #define ZD "%zd" #else #define ZD "%u" Index: tests/OFObject/Makefile ================================================================== --- tests/OFObject/Makefile +++ tests/OFObject/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST} Index: tests/OFString/Makefile ================================================================== --- tests/OFString/Makefile +++ tests/OFString/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST} Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -9,15 +9,16 @@ * the packaging of this file. */ #import "config.h" -#import #import #import "OFString.h" #import "OFExceptions.h" + +#import #ifndef _WIN32 #define ZD "%zd" #else #define ZD "%u" Index: tests/OFTCPSocket/Makefile ================================================================== --- tests/OFTCPSocket/Makefile +++ tests/OFTCPSocket/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc ${WS2_LIBS} +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST} Index: tests/OFTCPSocket/OFTCPSocket.m ================================================================== --- tests/OFTCPSocket/OFTCPSocket.m +++ tests/OFTCPSocket/OFTCPSocket.m @@ -36,12 +36,10 @@ uint16_t port; srand(time(NULL)); @try { - [OFTCPSocket startup]; - OFTCPSocket *server = [OFTCPSocket new]; OFTCPSocket *client = [OFTCPSocket new]; OFTCPSocket *accepted; char buf[7]; Index: tests/OFXMLFactory/Makefile ================================================================== --- tests/OFXMLFactory/Makefile +++ tests/OFXMLFactory/Makefile @@ -3,11 +3,11 @@ include ../../buildsys.mk include ../../extra.mk CPPFLAGS += -I../../src -I../.. -LIBS += -L../../src -lobjfw -lobjc +LIBS := -L../../src -lobjfw ${LIBS} .PHONY: run all: run run: ${PROG_NOINST}