Mon, 09 Sep 2013 11:54:32 +0200
removed unnecessary configurations + added build command for shared lib
Makefile | file | annotate | diff | comparison | revisions | |
README | file | annotate | diff | comparison | revisions | |
clang.mk | file | annotate | diff | comparison | revisions | |
g++.mk | file | annotate | diff | comparison | revisions | |
gcc.mk | file | annotate | diff | comparison | revisions | |
msc/inttypes.h | file | annotate | diff | comparison | revisions | |
msc/stdint.h | file | annotate | diff | comparison | revisions | |
osx.mk | file | annotate | diff | comparison | revisions | |
suncc.mk | file | annotate | diff | comparison | revisions | |
test/Makefile | file | annotate | diff | comparison | revisions | |
ucx/Makefile | file | annotate | diff | comparison | revisions | |
windows.mk | file | annotate | diff | comparison | revisions |
1.1 --- a/Makefile Mon Sep 09 10:48:08 2013 +0200 1.2 +++ b/Makefile Mon Sep 09 11:54:32 2013 +0200 1.3 @@ -31,10 +31,8 @@ 1.4 # available configurations: 1.5 # clang 1.6 # gcc 1.7 -# g++ 1.8 # osx 1.9 # suncc 1.10 -# windows 1.11 # 1.12 1.13 CONF=gcc 1.14 @@ -66,11 +64,13 @@ 1.15 1.16 install: ucx $(PREFIX)/lib $(PREFIX)/include/ucx 1.17 cp ./build/release/libucx$(LIB_EXT) $(PREFIX)/lib && \ 1.18 + cp ./build/release/libucx$(SO_EXT) $(PREFIX)/lib && \ 1.19 cp ./ucx/*.h $(PREFIX)/include/ucx 1.20 1.21 uninstall: 1.22 $(RM) $(RMFLAGS) $(PREFIX)/include/ucx &&\ 1.23 - $(RM) $(RMFLAGS) $(PREFIX)/lib/libucx$(LIB_EXT) 1.24 + $(RM) $(RMFLAGS) $(PREFIX)/lib/libucx$(LIB_EXT) &&\ 1.25 + $(RM) $(RMFLAGS) $(PREFIX)/lib/libucx$(SO_EXT) 1.26 1.27 $(PREFIX)/lib: 1.28 mkdir -p $(PREFIX)/lib
2.1 --- a/README Mon Sep 09 10:48:08 2013 +0200 2.2 +++ b/README Mon Sep 09 11:54:32 2013 +0200 2.3 @@ -7,9 +7,9 @@ 2.4 2.5 1. Introduction ........................................................ 15 2.6 2. Build ............................................................... 25 2.7 - 3. Install ............................................................. 58 2.8 - 4. Documentation ....................................................... 70 2.9 - 5. Contact ............................................................. 78 2.10 + 3. Install ............................................................. 56 2.11 + 4. Documentation ....................................................... 68 2.12 + 5. Contact ............................................................. 76 2.13 2.14 2.15 1. Introduction 2.16 @@ -32,9 +32,7 @@ 2.17 2.18 make 2.19 2.20 -The available configurations are clang, gcc, g++, osx, suncc and windows. The 2.21 -later uses microsoft visual C++ compiler. If you want to use mingw oder cygwin, 2.22 -you can use the default gcc configuration. 2.23 +The available configurations are clang, gcc, osx and suncc. 2.24 2.25 The build files are placed into a build subdirectory, which is created if it 2.26 does not exists.
3.1 --- a/clang.mk Mon Sep 09 10:48:08 2013 +0200 3.2 +++ b/clang.mk Mon Sep 09 11:54:32 2013 +0200 3.3 @@ -32,17 +32,15 @@ 3.4 RM = rm 3.5 MKDIR = mkdir 3.6 3.7 -CFLAGS = -std=gnu99 -O2 -fstrict-aliasing -c 3.8 -CFLAGS_D = -std=gnu99 -g -fstrict-aliasing -Wall -pedantic -c 3.9 -COFLAGS = -o 3.10 +CFLAGS = -fPIC -O2 -fstrict-aliasing 3.11 +CFLAGS_D = -fPIC -g -fstrict-aliasing -Wall -pedantic 3.12 LDFLAGS = -lm 3.13 -LDFLAGS_D = -lm 3.14 -LOFLAGS = -o 3.15 +SOLDFLAGS = -lm -shared 3.16 ARFLAGS = -r 3.17 -AOFLAGS = 3.18 RMFLAGS = -f -R 3.19 MKDIRFLAGS = -p 3.20 3.21 OBJ_EXT = .o 3.22 +SO_EXT = .so 3.23 LIB_EXT = .a 3.24 APP_EXT =
4.1 --- a/g++.mk Mon Sep 09 10:48:08 2013 +0200 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,48 +0,0 @@ 4.4 -# 4.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 4.6 -# 4.7 -# Copyright 2013 Olaf Wintermann. All rights reserved. 4.8 -# 4.9 -# Redistribution and use in source and binary forms, with or without 4.10 -# modification, are permitted provided that the following conditions are met: 4.11 -# 4.12 -# 1. Redistributions of source code must retain the above copyright 4.13 -# notice, this list of conditions and the following disclaimer. 4.14 -# 4.15 -# 2. Redistributions in binary form must reproduce the above copyright 4.16 -# notice, this list of conditions and the following disclaimer in the 4.17 -# documentation and/or other materials provided with the distribution. 4.18 -# 4.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 4.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 4.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 4.22 -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 4.23 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 4.24 -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 4.25 -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 4.26 -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 4.27 -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 4.28 -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4.29 -# POSSIBILITY OF SUCH DAMAGE. 4.30 -# 4.31 - 4.32 -CC = g++ 4.33 -LD = g++ 4.34 -AR = ar 4.35 -RM = rm 4.36 -MKDIR = mkdir 4.37 - 4.38 -CFLAGS = -std=gnu++0x -O2 -fstrict-aliasing -c 4.39 -CFLAGS_D = -std=gnu++0x -g -fstrict-aliasing -Wall -pedantic -c 4.40 -COFLAGS = -o 4.41 -LDFLAGS = 4.42 -LDFLAGS_D = 4.43 -LOFLAGS = -o 4.44 -ARFLAGS = -r 4.45 -AOFLAGS = 4.46 -RMFLAGS = -f -R 4.47 -MKDIRFLAGS = -p 4.48 - 4.49 -OBJ_EXT = .o 4.50 -LIB_EXT = .a 4.51 -APP_EXT =
5.1 --- a/gcc.mk Mon Sep 09 10:48:08 2013 +0200 5.2 +++ b/gcc.mk Mon Sep 09 11:54:32 2013 +0200 5.3 @@ -32,17 +32,15 @@ 5.4 RM = rm 5.5 MKDIR = mkdir 5.6 5.7 -CFLAGS = -std=gnu99 -O2 -fstrict-aliasing -c 5.8 -CFLAGS_D = -std=gnu99 -g -fstrict-aliasing -Wall -pedantic -c 5.9 -COFLAGS = -o 5.10 +CFLAGS = -std=gnu99 -O2 -fstrict-aliasing -fPIC 5.11 +CFLAGS_D = -std=gnu99 -g -fstrict-aliasing -Wall -pedantic -fPIC 5.12 LDFLAGS = 5.13 -LDFLAGS_D = 5.14 -LOFLAGS = -o 5.15 +SOLDFLAGS = -shared 5.16 ARFLAGS = -r 5.17 -AOFLAGS = 5.18 RMFLAGS = -f -R 5.19 MKDIRFLAGS = -p 5.20 5.21 OBJ_EXT = .o 5.22 +SO_EXT = .so 5.23 LIB_EXT = .a 5.24 APP_EXT =
6.1 --- a/msc/inttypes.h Mon Sep 09 10:48:08 2013 +0200 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,305 +0,0 @@ 6.4 -// ISO C9x compliant inttypes.h for Microsoft Visual Studio 6.5 -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 6.6 -// 6.7 -// Copyright (c) 2006 Alexander Chemeris 6.8 -// 6.9 -// Redistribution and use in source and binary forms, with or without 6.10 -// modification, are permitted provided that the following conditions are met: 6.11 -// 6.12 -// 1. Redistributions of source code must retain the above copyright notice, 6.13 -// this list of conditions and the following disclaimer. 6.14 -// 6.15 -// 2. Redistributions in binary form must reproduce the above copyright 6.16 -// notice, this list of conditions and the following disclaimer in the 6.17 -// documentation and/or other materials provided with the distribution. 6.18 -// 6.19 -// 3. The name of the author may be used to endorse or promote products 6.20 -// derived from this software without specific prior written permission. 6.21 -// 6.22 -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 6.23 -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 6.24 -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 6.25 -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6.26 -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 6.27 -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 6.28 -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 6.29 -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 6.30 -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 6.31 -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 6.32 -// 6.33 -/////////////////////////////////////////////////////////////////////////////// 6.34 - 6.35 -#ifndef _MSC_VER // [ 6.36 -#error "Use this header only with Microsoft Visual C++ compilers!" 6.37 -#endif // _MSC_VER ] 6.38 - 6.39 -#ifndef _MSC_INTTYPES_H_ // [ 6.40 -#define _MSC_INTTYPES_H_ 6.41 - 6.42 -#if _MSC_VER > 1000 6.43 -#pragma once 6.44 -#endif 6.45 - 6.46 -#include "stdint.h" 6.47 - 6.48 -// 7.8 Format conversion of integer types 6.49 - 6.50 -typedef struct { 6.51 - intmax_t quot; 6.52 - intmax_t rem; 6.53 -} imaxdiv_t; 6.54 - 6.55 -// 7.8.1 Macros for format specifiers 6.56 - 6.57 -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 6.58 - 6.59 -// The fprintf macros for signed integers are: 6.60 -#define PRId8 "d" 6.61 -#define PRIi8 "i" 6.62 -#define PRIdLEAST8 "d" 6.63 -#define PRIiLEAST8 "i" 6.64 -#define PRIdFAST8 "d" 6.65 -#define PRIiFAST8 "i" 6.66 - 6.67 -#define PRId16 "hd" 6.68 -#define PRIi16 "hi" 6.69 -#define PRIdLEAST16 "hd" 6.70 -#define PRIiLEAST16 "hi" 6.71 -#define PRIdFAST16 "hd" 6.72 -#define PRIiFAST16 "hi" 6.73 - 6.74 -#define PRId32 "I32d" 6.75 -#define PRIi32 "I32i" 6.76 -#define PRIdLEAST32 "I32d" 6.77 -#define PRIiLEAST32 "I32i" 6.78 -#define PRIdFAST32 "I32d" 6.79 -#define PRIiFAST32 "I32i" 6.80 - 6.81 -#define PRId64 "I64d" 6.82 -#define PRIi64 "I64i" 6.83 -#define PRIdLEAST64 "I64d" 6.84 -#define PRIiLEAST64 "I64i" 6.85 -#define PRIdFAST64 "I64d" 6.86 -#define PRIiFAST64 "I64i" 6.87 - 6.88 -#define PRIdMAX "I64d" 6.89 -#define PRIiMAX "I64i" 6.90 - 6.91 -#define PRIdPTR "Id" 6.92 -#define PRIiPTR "Ii" 6.93 - 6.94 -// The fprintf macros for unsigned integers are: 6.95 -#define PRIo8 "o" 6.96 -#define PRIu8 "u" 6.97 -#define PRIx8 "x" 6.98 -#define PRIX8 "X" 6.99 -#define PRIoLEAST8 "o" 6.100 -#define PRIuLEAST8 "u" 6.101 -#define PRIxLEAST8 "x" 6.102 -#define PRIXLEAST8 "X" 6.103 -#define PRIoFAST8 "o" 6.104 -#define PRIuFAST8 "u" 6.105 -#define PRIxFAST8 "x" 6.106 -#define PRIXFAST8 "X" 6.107 - 6.108 -#define PRIo16 "ho" 6.109 -#define PRIu16 "hu" 6.110 -#define PRIx16 "hx" 6.111 -#define PRIX16 "hX" 6.112 -#define PRIoLEAST16 "ho" 6.113 -#define PRIuLEAST16 "hu" 6.114 -#define PRIxLEAST16 "hx" 6.115 -#define PRIXLEAST16 "hX" 6.116 -#define PRIoFAST16 "ho" 6.117 -#define PRIuFAST16 "hu" 6.118 -#define PRIxFAST16 "hx" 6.119 -#define PRIXFAST16 "hX" 6.120 - 6.121 -#define PRIo32 "I32o" 6.122 -#define PRIu32 "I32u" 6.123 -#define PRIx32 "I32x" 6.124 -#define PRIX32 "I32X" 6.125 -#define PRIoLEAST32 "I32o" 6.126 -#define PRIuLEAST32 "I32u" 6.127 -#define PRIxLEAST32 "I32x" 6.128 -#define PRIXLEAST32 "I32X" 6.129 -#define PRIoFAST32 "I32o" 6.130 -#define PRIuFAST32 "I32u" 6.131 -#define PRIxFAST32 "I32x" 6.132 -#define PRIXFAST32 "I32X" 6.133 - 6.134 -#define PRIo64 "I64o" 6.135 -#define PRIu64 "I64u" 6.136 -#define PRIx64 "I64x" 6.137 -#define PRIX64 "I64X" 6.138 -#define PRIoLEAST64 "I64o" 6.139 -#define PRIuLEAST64 "I64u" 6.140 -#define PRIxLEAST64 "I64x" 6.141 -#define PRIXLEAST64 "I64X" 6.142 -#define PRIoFAST64 "I64o" 6.143 -#define PRIuFAST64 "I64u" 6.144 -#define PRIxFAST64 "I64x" 6.145 -#define PRIXFAST64 "I64X" 6.146 - 6.147 -#define PRIoMAX "I64o" 6.148 -#define PRIuMAX "I64u" 6.149 -#define PRIxMAX "I64x" 6.150 -#define PRIXMAX "I64X" 6.151 - 6.152 -#define PRIoPTR "Io" 6.153 -#define PRIuPTR "Iu" 6.154 -#define PRIxPTR "Ix" 6.155 -#define PRIXPTR "IX" 6.156 - 6.157 -// The fscanf macros for signed integers are: 6.158 -#define SCNd8 "d" 6.159 -#define SCNi8 "i" 6.160 -#define SCNdLEAST8 "d" 6.161 -#define SCNiLEAST8 "i" 6.162 -#define SCNdFAST8 "d" 6.163 -#define SCNiFAST8 "i" 6.164 - 6.165 -#define SCNd16 "hd" 6.166 -#define SCNi16 "hi" 6.167 -#define SCNdLEAST16 "hd" 6.168 -#define SCNiLEAST16 "hi" 6.169 -#define SCNdFAST16 "hd" 6.170 -#define SCNiFAST16 "hi" 6.171 - 6.172 -#define SCNd32 "ld" 6.173 -#define SCNi32 "li" 6.174 -#define SCNdLEAST32 "ld" 6.175 -#define SCNiLEAST32 "li" 6.176 -#define SCNdFAST32 "ld" 6.177 -#define SCNiFAST32 "li" 6.178 - 6.179 -#define SCNd64 "I64d" 6.180 -#define SCNi64 "I64i" 6.181 -#define SCNdLEAST64 "I64d" 6.182 -#define SCNiLEAST64 "I64i" 6.183 -#define SCNdFAST64 "I64d" 6.184 -#define SCNiFAST64 "I64i" 6.185 - 6.186 -#define SCNdMAX "I64d" 6.187 -#define SCNiMAX "I64i" 6.188 - 6.189 -#ifdef _WIN64 // [ 6.190 -# define SCNdPTR "I64d" 6.191 -# define SCNiPTR "I64i" 6.192 -#else // _WIN64 ][ 6.193 -# define SCNdPTR "ld" 6.194 -# define SCNiPTR "li" 6.195 -#endif // _WIN64 ] 6.196 - 6.197 -// The fscanf macros for unsigned integers are: 6.198 -#define SCNo8 "o" 6.199 -#define SCNu8 "u" 6.200 -#define SCNx8 "x" 6.201 -#define SCNX8 "X" 6.202 -#define SCNoLEAST8 "o" 6.203 -#define SCNuLEAST8 "u" 6.204 -#define SCNxLEAST8 "x" 6.205 -#define SCNXLEAST8 "X" 6.206 -#define SCNoFAST8 "o" 6.207 -#define SCNuFAST8 "u" 6.208 -#define SCNxFAST8 "x" 6.209 -#define SCNXFAST8 "X" 6.210 - 6.211 -#define SCNo16 "ho" 6.212 -#define SCNu16 "hu" 6.213 -#define SCNx16 "hx" 6.214 -#define SCNX16 "hX" 6.215 -#define SCNoLEAST16 "ho" 6.216 -#define SCNuLEAST16 "hu" 6.217 -#define SCNxLEAST16 "hx" 6.218 -#define SCNXLEAST16 "hX" 6.219 -#define SCNoFAST16 "ho" 6.220 -#define SCNuFAST16 "hu" 6.221 -#define SCNxFAST16 "hx" 6.222 -#define SCNXFAST16 "hX" 6.223 - 6.224 -#define SCNo32 "lo" 6.225 -#define SCNu32 "lu" 6.226 -#define SCNx32 "lx" 6.227 -#define SCNX32 "lX" 6.228 -#define SCNoLEAST32 "lo" 6.229 -#define SCNuLEAST32 "lu" 6.230 -#define SCNxLEAST32 "lx" 6.231 -#define SCNXLEAST32 "lX" 6.232 -#define SCNoFAST32 "lo" 6.233 -#define SCNuFAST32 "lu" 6.234 -#define SCNxFAST32 "lx" 6.235 -#define SCNXFAST32 "lX" 6.236 - 6.237 -#define SCNo64 "I64o" 6.238 -#define SCNu64 "I64u" 6.239 -#define SCNx64 "I64x" 6.240 -#define SCNX64 "I64X" 6.241 -#define SCNoLEAST64 "I64o" 6.242 -#define SCNuLEAST64 "I64u" 6.243 -#define SCNxLEAST64 "I64x" 6.244 -#define SCNXLEAST64 "I64X" 6.245 -#define SCNoFAST64 "I64o" 6.246 -#define SCNuFAST64 "I64u" 6.247 -#define SCNxFAST64 "I64x" 6.248 -#define SCNXFAST64 "I64X" 6.249 - 6.250 -#define SCNoMAX "I64o" 6.251 -#define SCNuMAX "I64u" 6.252 -#define SCNxMAX "I64x" 6.253 -#define SCNXMAX "I64X" 6.254 - 6.255 -#ifdef _WIN64 // [ 6.256 -# define SCNoPTR "I64o" 6.257 -# define SCNuPTR "I64u" 6.258 -# define SCNxPTR "I64x" 6.259 -# define SCNXPTR "I64X" 6.260 -#else // _WIN64 ][ 6.261 -# define SCNoPTR "lo" 6.262 -# define SCNuPTR "lu" 6.263 -# define SCNxPTR "lx" 6.264 -# define SCNXPTR "lX" 6.265 -#endif // _WIN64 ] 6.266 - 6.267 -#endif // __STDC_FORMAT_MACROS ] 6.268 - 6.269 -// 7.8.2 Functions for greatest-width integer types 6.270 - 6.271 -// 7.8.2.1 The imaxabs function 6.272 -#define imaxabs _abs64 6.273 - 6.274 -// 7.8.2.2 The imaxdiv function 6.275 - 6.276 -// This is modified version of div() function from Microsoft's div.c found 6.277 -// in %MSVC.NET%\crt\src\div.c 6.278 -#ifdef STATIC_IMAXDIV // [ 6.279 -static 6.280 -#else // STATIC_IMAXDIV ][ 6.281 -_inline 6.282 -#endif // STATIC_IMAXDIV ] 6.283 -imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) 6.284 -{ 6.285 - imaxdiv_t result; 6.286 - 6.287 - result.quot = numer / denom; 6.288 - result.rem = numer % denom; 6.289 - 6.290 - if (numer < 0 && result.rem > 0) { 6.291 - // did division wrong; must fix up 6.292 - ++result.quot; 6.293 - result.rem -= denom; 6.294 - } 6.295 - 6.296 - return result; 6.297 -} 6.298 - 6.299 -// 7.8.2.3 The strtoimax and strtoumax functions 6.300 -#define strtoimax _strtoi64 6.301 -#define strtoumax _strtoui64 6.302 - 6.303 -// 7.8.2.4 The wcstoimax and wcstoumax functions 6.304 -#define wcstoimax _wcstoi64 6.305 -#define wcstoumax _wcstoui64 6.306 - 6.307 - 6.308 -#endif // _MSC_INTTYPES_H_ ]
7.1 --- a/msc/stdint.h Mon Sep 09 10:48:08 2013 +0200 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,247 +0,0 @@ 7.4 -// ISO C9x compliant stdint.h for Microsoft Visual Studio 7.5 -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 7.6 -// 7.7 -// Copyright (c) 2006-2008 Alexander Chemeris 7.8 -// 7.9 -// Redistribution and use in source and binary forms, with or without 7.10 -// modification, are permitted provided that the following conditions are met: 7.11 -// 7.12 -// 1. Redistributions of source code must retain the above copyright notice, 7.13 -// this list of conditions and the following disclaimer. 7.14 -// 7.15 -// 2. Redistributions in binary form must reproduce the above copyright 7.16 -// notice, this list of conditions and the following disclaimer in the 7.17 -// documentation and/or other materials provided with the distribution. 7.18 -// 7.19 -// 3. The name of the author may be used to endorse or promote products 7.20 -// derived from this software without specific prior written permission. 7.21 -// 7.22 -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 7.23 -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 7.24 -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 7.25 -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 7.26 -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 7.27 -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 7.28 -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 7.29 -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 7.30 -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 7.31 -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7.32 -// 7.33 -/////////////////////////////////////////////////////////////////////////////// 7.34 - 7.35 -#ifndef _MSC_VER // [ 7.36 -#error "Use this header only with Microsoft Visual C++ compilers!" 7.37 -#endif // _MSC_VER ] 7.38 - 7.39 -#ifndef _MSC_STDINT_H_ // [ 7.40 -#define _MSC_STDINT_H_ 7.41 - 7.42 -#if _MSC_VER > 1000 7.43 -#pragma once 7.44 -#endif 7.45 - 7.46 -#include <limits.h> 7.47 - 7.48 -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when 7.49 -// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}' 7.50 -// or compiler give many errors like this: 7.51 -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed 7.52 -#ifdef __cplusplus 7.53 -extern "C" { 7.54 -#endif 7.55 -# include <wchar.h> 7.56 -#ifdef __cplusplus 7.57 -} 7.58 -#endif 7.59 - 7.60 -// Define _W64 macros to mark types changing their size, like intptr_t. 7.61 -#ifndef _W64 7.62 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 7.63 -# define _W64 __w64 7.64 -# else 7.65 -# define _W64 7.66 -# endif 7.67 -#endif 7.68 - 7.69 - 7.70 -// 7.18.1 Integer types 7.71 - 7.72 -// 7.18.1.1 Exact-width integer types 7.73 - 7.74 -// Visual Studio 6 and Embedded Visual C++ 4 doesn't 7.75 -// realize that, e.g. char has the same size as __int8 7.76 -// so we give up on __intX for them. 7.77 -#if (_MSC_VER < 1300) 7.78 - typedef signed char int8_t; 7.79 - typedef signed short int16_t; 7.80 - typedef signed int int32_t; 7.81 - typedef unsigned char uint8_t; 7.82 - typedef unsigned short uint16_t; 7.83 - typedef unsigned int uint32_t; 7.84 -#else 7.85 - typedef signed __int8 int8_t; 7.86 - typedef signed __int16 int16_t; 7.87 - typedef signed __int32 int32_t; 7.88 - typedef unsigned __int8 uint8_t; 7.89 - typedef unsigned __int16 uint16_t; 7.90 - typedef unsigned __int32 uint32_t; 7.91 -#endif 7.92 -typedef signed __int64 int64_t; 7.93 -typedef unsigned __int64 uint64_t; 7.94 - 7.95 - 7.96 -// 7.18.1.2 Minimum-width integer types 7.97 -typedef int8_t int_least8_t; 7.98 -typedef int16_t int_least16_t; 7.99 -typedef int32_t int_least32_t; 7.100 -typedef int64_t int_least64_t; 7.101 -typedef uint8_t uint_least8_t; 7.102 -typedef uint16_t uint_least16_t; 7.103 -typedef uint32_t uint_least32_t; 7.104 -typedef uint64_t uint_least64_t; 7.105 - 7.106 -// 7.18.1.3 Fastest minimum-width integer types 7.107 -typedef int8_t int_fast8_t; 7.108 -typedef int16_t int_fast16_t; 7.109 -typedef int32_t int_fast32_t; 7.110 -typedef int64_t int_fast64_t; 7.111 -typedef uint8_t uint_fast8_t; 7.112 -typedef uint16_t uint_fast16_t; 7.113 -typedef uint32_t uint_fast32_t; 7.114 -typedef uint64_t uint_fast64_t; 7.115 - 7.116 -// 7.18.1.4 Integer types capable of holding object pointers 7.117 -#ifdef _WIN64 // [ 7.118 - typedef signed __int64 intptr_t; 7.119 - typedef unsigned __int64 uintptr_t; 7.120 -#else // _WIN64 ][ 7.121 - typedef _W64 signed int intptr_t; 7.122 - typedef _W64 unsigned int uintptr_t; 7.123 -#endif // _WIN64 ] 7.124 - 7.125 -// 7.18.1.5 Greatest-width integer types 7.126 -typedef int64_t intmax_t; 7.127 -typedef uint64_t uintmax_t; 7.128 - 7.129 - 7.130 -// 7.18.2 Limits of specified-width integer types 7.131 - 7.132 -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 7.133 - 7.134 -// 7.18.2.1 Limits of exact-width integer types 7.135 -#define INT8_MIN ((int8_t)_I8_MIN) 7.136 -#define INT8_MAX _I8_MAX 7.137 -#define INT16_MIN ((int16_t)_I16_MIN) 7.138 -#define INT16_MAX _I16_MAX 7.139 -#define INT32_MIN ((int32_t)_I32_MIN) 7.140 -#define INT32_MAX _I32_MAX 7.141 -#define INT64_MIN ((int64_t)_I64_MIN) 7.142 -#define INT64_MAX _I64_MAX 7.143 -#define UINT8_MAX _UI8_MAX 7.144 -#define UINT16_MAX _UI16_MAX 7.145 -#define UINT32_MAX _UI32_MAX 7.146 -#define UINT64_MAX _UI64_MAX 7.147 - 7.148 -// 7.18.2.2 Limits of minimum-width integer types 7.149 -#define INT_LEAST8_MIN INT8_MIN 7.150 -#define INT_LEAST8_MAX INT8_MAX 7.151 -#define INT_LEAST16_MIN INT16_MIN 7.152 -#define INT_LEAST16_MAX INT16_MAX 7.153 -#define INT_LEAST32_MIN INT32_MIN 7.154 -#define INT_LEAST32_MAX INT32_MAX 7.155 -#define INT_LEAST64_MIN INT64_MIN 7.156 -#define INT_LEAST64_MAX INT64_MAX 7.157 -#define UINT_LEAST8_MAX UINT8_MAX 7.158 -#define UINT_LEAST16_MAX UINT16_MAX 7.159 -#define UINT_LEAST32_MAX UINT32_MAX 7.160 -#define UINT_LEAST64_MAX UINT64_MAX 7.161 - 7.162 -// 7.18.2.3 Limits of fastest minimum-width integer types 7.163 -#define INT_FAST8_MIN INT8_MIN 7.164 -#define INT_FAST8_MAX INT8_MAX 7.165 -#define INT_FAST16_MIN INT16_MIN 7.166 -#define INT_FAST16_MAX INT16_MAX 7.167 -#define INT_FAST32_MIN INT32_MIN 7.168 -#define INT_FAST32_MAX INT32_MAX 7.169 -#define INT_FAST64_MIN INT64_MIN 7.170 -#define INT_FAST64_MAX INT64_MAX 7.171 -#define UINT_FAST8_MAX UINT8_MAX 7.172 -#define UINT_FAST16_MAX UINT16_MAX 7.173 -#define UINT_FAST32_MAX UINT32_MAX 7.174 -#define UINT_FAST64_MAX UINT64_MAX 7.175 - 7.176 -// 7.18.2.4 Limits of integer types capable of holding object pointers 7.177 -#ifdef _WIN64 // [ 7.178 -# define INTPTR_MIN INT64_MIN 7.179 -# define INTPTR_MAX INT64_MAX 7.180 -# define UINTPTR_MAX UINT64_MAX 7.181 -#else // _WIN64 ][ 7.182 -# define INTPTR_MIN INT32_MIN 7.183 -# define INTPTR_MAX INT32_MAX 7.184 -# define UINTPTR_MAX UINT32_MAX 7.185 -#endif // _WIN64 ] 7.186 - 7.187 -// 7.18.2.5 Limits of greatest-width integer types 7.188 -#define INTMAX_MIN INT64_MIN 7.189 -#define INTMAX_MAX INT64_MAX 7.190 -#define UINTMAX_MAX UINT64_MAX 7.191 - 7.192 -// 7.18.3 Limits of other integer types 7.193 - 7.194 -#ifdef _WIN64 // [ 7.195 -# define PTRDIFF_MIN _I64_MIN 7.196 -# define PTRDIFF_MAX _I64_MAX 7.197 -#else // _WIN64 ][ 7.198 -# define PTRDIFF_MIN _I32_MIN 7.199 -# define PTRDIFF_MAX _I32_MAX 7.200 -#endif // _WIN64 ] 7.201 - 7.202 -#define SIG_ATOMIC_MIN INT_MIN 7.203 -#define SIG_ATOMIC_MAX INT_MAX 7.204 - 7.205 -#ifndef SIZE_MAX // [ 7.206 -# ifdef _WIN64 // [ 7.207 -# define SIZE_MAX _UI64_MAX 7.208 -# else // _WIN64 ][ 7.209 -# define SIZE_MAX _UI32_MAX 7.210 -# endif // _WIN64 ] 7.211 -#endif // SIZE_MAX ] 7.212 - 7.213 -// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> 7.214 -#ifndef WCHAR_MIN // [ 7.215 -# define WCHAR_MIN 0 7.216 -#endif // WCHAR_MIN ] 7.217 -#ifndef WCHAR_MAX // [ 7.218 -# define WCHAR_MAX _UI16_MAX 7.219 -#endif // WCHAR_MAX ] 7.220 - 7.221 -#define WINT_MIN 0 7.222 -#define WINT_MAX _UI16_MAX 7.223 - 7.224 -#endif // __STDC_LIMIT_MACROS ] 7.225 - 7.226 - 7.227 -// 7.18.4 Limits of other integer types 7.228 - 7.229 -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 7.230 - 7.231 -// 7.18.4.1 Macros for minimum-width integer constants 7.232 - 7.233 -#define INT8_C(val) val##i8 7.234 -#define INT16_C(val) val##i16 7.235 -#define INT32_C(val) val##i32 7.236 -#define INT64_C(val) val##i64 7.237 - 7.238 -#define UINT8_C(val) val##ui8 7.239 -#define UINT16_C(val) val##ui16 7.240 -#define UINT32_C(val) val##ui32 7.241 -#define UINT64_C(val) val##ui64 7.242 - 7.243 -// 7.18.4.2 Macros for greatest-width integer constants 7.244 -#define INTMAX_C INT64_C 7.245 -#define UINTMAX_C UINT64_C 7.246 - 7.247 -#endif // __STDC_CONSTANT_MACROS ] 7.248 - 7.249 - 7.250 -#endif // _MSC_STDINT_H_ ]
8.1 --- a/osx.mk Mon Sep 09 10:48:08 2013 +0200 8.2 +++ b/osx.mk Mon Sep 09 11:54:32 2013 +0200 8.3 @@ -32,17 +32,15 @@ 8.4 RM = rm 8.5 MKDIR = mkdir 8.6 8.7 -CFLAGS = -O2 -c 8.8 -CFLAGS_D = -g -c 8.9 -COFLAGS = -o 8.10 +CFLAGS = -fPIC -O2 -fstrict-aliasing 8.11 +CFLAGS_D = -fPIC -g -fstrict-aliasing -Wall -pedantic 8.12 LDFLAGS = 8.13 -LDFLAGS_D = 8.14 -LOFLAGS = -o 8.15 +SOLDFLAGS = -shared 8.16 ARFLAGS = -r 8.17 -AOFLAGS = 8.18 RMFLAGS = -f -R 8.19 MKDIRFLAGS = -p 8.20 8.21 OBJ_EXT = .o 8.22 +SO_EXT = .dylib 8.23 LIB_EXT = .a 8.24 APP_EXT =
9.1 --- a/suncc.mk Mon Sep 09 10:48:08 2013 +0200 9.2 +++ b/suncc.mk Mon Sep 09 11:54:32 2013 +0200 9.3 @@ -32,17 +32,15 @@ 9.4 RM = rm 9.5 MKDIR = mkdir 9.6 9.7 -CFLAGS = -O -c 9.8 -CFLAGS_D = -g -c 9.9 -COFLAGS = -o 9.10 +CFLAGS = -Kpic -O 9.11 +CFLAGS_D = -Kpic -g 9.12 LDFLAGS = -lm 9.13 -LDFLAGS_D = -lm 9.14 -LOFLAGS = -o 9.15 +SOLDFLAGS = -lm 9.16 ARFLAGS = -r 9.17 -AOFLAGS = 9.18 RMFLAGS = -f -R 9.19 MKDIRFLAGS = -p 9.20 9.21 OBJ_EXT = .o 9.22 +SO_EXT = .so 9.23 LIB_EXT = .a 9.24 APP_EXT =
10.1 --- a/test/Makefile Mon Sep 09 10:48:08 2013 +0200 10.2 +++ b/test/Makefile Mon Sep 09 11:54:32 2013 +0200 10.3 @@ -45,21 +45,21 @@ 10.4 debug: ../build/debug/test ../build/debug/test/ucxtest$(APP_EXT) 10.5 10.6 ../build/release/test/ucxtest$(APP_EXT): $(OBJ) 10.7 - $(LD) $(LDFLAGS) $(LOFLAGS)../build/release/test/ucxtest$(APP_EXT) \ 10.8 + $(LD) $(LDFLAGS) -o ../build/release/test/ucxtest$(APP_EXT) \ 10.9 $(OBJ) ../build/release/libucx$(LIB_EXT) 10.10 10.11 ../build/release/test/%$(OBJ_EXT): %.c 10.12 - $(CC) $(CFLAGS) -I../ $(COFLAGS)$@ $< 10.13 + $(CC) $(CFLAGS) -I../ -o $@ -c $< 10.14 10.15 ../build/release/test: 10.16 $(MKDIR) $(MKDIRFLAGS) ../build/release/test 10.17 10.18 ../build/debug/test/ucxtest$(APP_EXT): $(OBJ_D) 10.19 - $(LD) $(LDFLAGS_D) $(LOFLAGS)../build/debug/test/ucxtest$(APP_EXT) \ 10.20 + $(LD) $(LDFLAGS) -o ../build/debug/test/ucxtest$(APP_EXT) \ 10.21 $(OBJ_D) ../build/debug/libucx$(LIB_EXT) 10.22 10.23 ../build/debug/test/%$(OBJ_EXT): %.c 10.24 - $(CC) $(CFLAGS_D) -I../ $(COFLAGS)$@ $< 10.25 + $(CC) $(CFLAGS_D) -I../ -o $@ -c $< 10.26 10.27 ../build/debug/test: 10.28 $(MKDIR) $(MKDIRFLAGS) ../build/debug/test
11.1 --- a/ucx/Makefile Mon Sep 09 10:48:08 2013 +0200 11.2 +++ b/ucx/Makefile Mon Sep 09 11:54:32 2013 +0200 11.3 @@ -43,23 +43,31 @@ 11.4 OBJ = $(SRC:%.c=../build/release/ucx/%$(OBJ_EXT)) 11.5 OBJ_D = $(SRC:%.c=../build/debug/ucx/%$(OBJ_EXT)) 11.6 11.7 -all: ../build/release/ucx ../build/release/libucx$(LIB_EXT) 11.8 -debug: ../build/debug/ucx ../build/debug/libucx$(LIB_EXT) 11.9 +all: ../build/release/ucx \ 11.10 + ../build/release/libucx$(LIB_EXT) ../build/release/libucx$(SO_EXT) 11.11 +debug: ../build/debug/ucx \ 11.12 + ../build/debug/libucx$(LIB_EXT) ../build/debug/libucx$(SO_EXT) 11.13 11.14 ../build/release/libucx$(LIB_EXT): $(OBJ) 11.15 - $(AR) $(ARFLAGS) $(AOFLAGS)../build/release/libucx$(LIB_EXT) $(OBJ) 11.16 + $(AR) $(ARFLAGS) ../build/release/libucx$(LIB_EXT) $(OBJ) 11.17 + 11.18 +../build/release/libucx$(SO_EXT): $(OBJ) 11.19 + $(LD) $(SOLDFLAGS) -o ../build/release/libucx$(SO_EXT) $(OBJ) 11.20 11.21 ../build/release/ucx/%$(OBJ_EXT): %.c 11.22 - $(CC) $(CFLAGS) $(COFLAGS)$@ $< 11.23 + $(CC) $(CFLAGS) -o $@ -c $< 11.24 11.25 ../build/release/ucx: 11.26 $(MKDIR) $(MKDIRFLAGS) ../build/release/ucx 11.27 11.28 ../build/debug/libucx$(LIB_EXT): $(OBJ_D) 11.29 - $(AR) $(ARFLAGS) $(AOFLAGS)../build/debug/libucx$(LIB_EXT) $(OBJ_D) 11.30 + $(AR) $(ARFLAGS) ../build/debug/libucx$(LIB_EXT) $(OBJ_D) 11.31 + 11.32 +../build/debug/libucx$(SO_EXT): $(OBJ_D) 11.33 + $(LD) $(SOLDFLAGS) -o ../build/debug/libucx$(SO_EXT) $(OBJ_D) 11.34 11.35 ../build/debug/ucx/%$(OBJ_EXT): %.c 11.36 - $(CC) $(CFLAGS_D) $(COFLAGS)$@ $< 11.37 + $(CC) $(CFLAGS_D) -o $@ -c $< 11.38 11.39 ../build/debug/ucx: 11.40 $(MKDIR) $(MKDIRFLAGS) ../build/debug/ucx
12.1 --- a/windows.mk Mon Sep 09 10:48:08 2013 +0200 12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 12.3 @@ -1,48 +0,0 @@ 12.4 -# 12.5 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 12.6 -# 12.7 -# Copyright 2013 Olaf Wintermann. All rights reserved. 12.8 -# 12.9 -# Redistribution and use in source and binary forms, with or without 12.10 -# modification, are permitted provided that the following conditions are met: 12.11 -# 12.12 -# 1. Redistributions of source code must retain the above copyright 12.13 -# notice, this list of conditions and the following disclaimer. 12.14 -# 12.15 -# 2. Redistributions in binary form must reproduce the above copyright 12.16 -# notice, this list of conditions and the following disclaimer in the 12.17 -# documentation and/or other materials provided with the distribution. 12.18 -# 12.19 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12.20 -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 12.21 -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 12.22 -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 12.23 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 12.24 -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 12.25 -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 12.26 -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 12.27 -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 12.28 -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 12.29 -# POSSIBILITY OF SUCH DAMAGE. 12.30 -# 12.31 - 12.32 -CC = cl 12.33 -LD = link 12.34 -AR = lib 12.35 -RM = rm 12.36 -MKDIR = mkdir 12.37 - 12.38 -CFLAGS = -c -TP -I../msc 12.39 -CFLAGS_D = -c -TP -I../msc 12.40 -COFLAGS = -Fo 12.41 -LDFLAGS = 12.42 -LDFLAGS_D = 12.43 -LOFLAGS = -OUT: 12.44 -ARFLAGS = 12.45 -AOFLAGS = -OUT: 12.46 -RMFLAGS = -f -R 12.47 -MKDIRFLAGS = -p 12.48 - 12.49 -OBJ_EXT = .obj 12.50 -LIB_EXT = .lib 12.51 -APP_EXT = .exe