diff options
author | Garrett D'Amore <garrett@damore.org> | 2016-04-18 12:04:53 -0700 |
---|---|---|
committer | Garrett D'Amore <garrett@damore.org> | 2016-04-18 14:53:49 -0700 |
commit | e5a932d1b92759f9d476527d26109a1f347b2006 (patch) | |
tree | e703bf2bad473819653f49733d2f0f2fe0935c9b /src/utils | |
parent | 5bb109305b5bd738576f9010f7264e4136bd1456 (diff) | |
download | nanomsg-e5a932d1b92759f9d476527d26109a1f347b2006.tar.gz |
fixes #629 Go ahead and require stdint.h and uint64_t
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/alloc.c | 2 | ||||
-rw-r--r-- | src/utils/atomic.h | 2 | ||||
-rw-r--r-- | src/utils/chunk.h | 2 | ||||
-rw-r--r-- | src/utils/chunkref.h | 2 | ||||
-rw-r--r-- | src/utils/clock.h | 2 | ||||
-rw-r--r-- | src/utils/efd_eventfd.inc | 2 | ||||
-rw-r--r-- | src/utils/efd_pipe.inc | 1 | ||||
-rw-r--r-- | src/utils/efd_socketpair.inc | 2 | ||||
-rw-r--r-- | src/utils/efd_win.inc | 2 | ||||
-rw-r--r-- | src/utils/hash.h | 2 | ||||
-rw-r--r-- | src/utils/int.h | 108 | ||||
-rw-r--r-- | src/utils/stopwatch.h | 3 | ||||
-rw-r--r-- | src/utils/wire.h | 2 |
13 files changed, 12 insertions, 120 deletions
diff --git a/src/utils/alloc.c b/src/utils/alloc.c index 1766b1d..59c229d 100644 --- a/src/utils/alloc.c +++ b/src/utils/alloc.c @@ -25,11 +25,11 @@ #if defined NN_ALLOC_MONITOR #include "mutex.h" -#include "int.h" #include <stdlib.h> #include <stddef.h> #include <stdio.h> +#include <stdint.h> struct nn_alloc_hdr { size_t size; diff --git a/src/utils/atomic.h b/src/utils/atomic.h index 1518935..ba746fe 100644 --- a/src/utils/atomic.h +++ b/src/utils/atomic.h @@ -36,7 +36,7 @@ #define NN_ATOMIC_MUTEX #endif -#include "int.h" +#include <stdint.h> struct nn_atomic { #if defined NN_ATOMIC_MUTEX diff --git a/src/utils/chunk.h b/src/utils/chunk.h index 64e72e5..762f215 100644 --- a/src/utils/chunk.h +++ b/src/utils/chunk.h @@ -24,7 +24,7 @@ #define NN_CHUNK_INCLUDED #include <stddef.h> -#include "int.h" +#include <stdint.h> /* Allocates the chunk using the allocation mechanism specified by 'type'. */ int nn_chunk_alloc (size_t size, int type, void **result); diff --git a/src/utils/chunkref.h b/src/utils/chunkref.h index 58d9a0f..e4b9349 100644 --- a/src/utils/chunkref.h +++ b/src/utils/chunkref.h @@ -26,9 +26,9 @@ #define NN_CHUNKREF_MAX 32 #include "chunk.h" -#include "int.h" #include <stddef.h> +#include <stdint.h> /* This class represents a reference to a data chunk. It's either an actual reference to data allocated on the heap, or if short enough, it may store diff --git a/src/utils/clock.h b/src/utils/clock.h index 1bb04b9..422baa5 100644 --- a/src/utils/clock.h +++ b/src/utils/clock.h @@ -23,7 +23,7 @@ #ifndef NN_CLOCK_INCLUDED #define NN_CLOCK_INCLUDED -#include "int.h" +#include <stdint.h> /* Optimised retrieval of the current time. The clock object is not thread-safe. */ diff --git a/src/utils/efd_eventfd.inc b/src/utils/efd_eventfd.inc index 2202db1..5fe1d7e 100644 --- a/src/utils/efd_eventfd.inc +++ b/src/utils/efd_eventfd.inc @@ -22,12 +22,12 @@ */ #include "err.h" -#include "int.h" #include "closefd.h" #include <sys/eventfd.h> #include <unistd.h> #include <fcntl.h> +#include <stdint.h> int nn_efd_init (struct nn_efd *self) { diff --git a/src/utils/efd_pipe.inc b/src/utils/efd_pipe.inc index cec5721..eeb8891 100644 --- a/src/utils/efd_pipe.inc +++ b/src/utils/efd_pipe.inc @@ -23,7 +23,6 @@ #include "err.h" #include "fast.h" -#include "int.h" #include "closefd.h" #include <sys/types.h> diff --git a/src/utils/efd_socketpair.inc b/src/utils/efd_socketpair.inc index 71ed572..017017f 100644 --- a/src/utils/efd_socketpair.inc +++ b/src/utils/efd_socketpair.inc @@ -23,13 +23,13 @@ #include "err.h" #include "fast.h" -#include "int.h" #include "closefd.h" #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <fcntl.h> +#include <stdint.h> int nn_efd_init (struct nn_efd *self) { diff --git a/src/utils/efd_win.inc b/src/utils/efd_win.inc index a9f6cda..03abbb1 100644 --- a/src/utils/efd_win.inc +++ b/src/utils/efd_win.inc @@ -26,9 +26,9 @@ #include "err.h" #include "fast.h" -#include "int.h" #include <string.h> +#include <stdint.h> int nn_efd_init (struct nn_efd *self) { diff --git a/src/utils/hash.h b/src/utils/hash.h index 09e4f4a..a9b5632 100644 --- a/src/utils/hash.h +++ b/src/utils/hash.h @@ -24,9 +24,9 @@ #define NN_HASH_INCLUDED #include "list.h" -#include "int.h" #include <stddef.h> +#include <stdint.h> /* Use for initialising a hash item statically. */ #define NN_HASH_ITEM_INITIALIZER {0xffff, NN_LIST_ITEM_INITILIZER} diff --git a/src/utils/int.h b/src/utils/int.h deleted file mode 100644 index 3df33b1..0000000 --- a/src/utils/int.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright (c) 2013 GoPivotal, Inc. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom - the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. -*/ - -#ifndef NN_INT_INCLUDED -#define NN_INT_INCLUDED - -#if defined NN_HAVE_WINDOWS && !defined NN_HAVE_STDINT - -/* Old versions of MSVC don't ship with stdint.h header file. - Thus, we have to define fix-sized integer type ourselves. */ - -#ifndef int8_t -typedef __int8 int8_t; -#endif -#ifndef uint8_t -typedef unsigned __int8 uint8_t; -#endif -#ifndef int16_t -typedef __int16 int16_t; -#endif -#ifndef uint16_t -typedef unsigned __int16 uint16_t; -#endif -#ifndef int32_t -typedef __int32 int32_t; -#endif -#ifndef uint32_t -typedef unsigned __int32 uint32_t; -#endif -#ifndef int64_t -typedef __int64 int64_t; -#endif -#ifndef uint64_t -typedef unsigned __int64 uint64_t; -#endif - -#ifndef INT8_MIN -#define INT8_MIN 0x80i8 -#endif -#ifndef INT16_MIN -#define INT16_MIN 0x8000i16 -#endif -#ifndef INT32_MIN -#define INT32_MIN 0x80000000i32 -#endif -#ifndef INT64_MIN -#define INT64_MIN 0x8000000000000000i64 -#endif -#ifndef INT8_MAX -#define INT8_MAX 0x7fi8 -#endif -#ifndef INT16_MAX -#define INT16_MAX 0x7fffi16 -#endif -#ifndef INT32_MAX -#define INT32_MAX 0x7fffffffi32 -#endif -#ifndef INT64_MAX -#define INT64_MAX 0x7fffffffffffffffi64 -#endif -#ifndef UINT8_MAX -#define UINT8_MAX 0xffui8 -#endif -#ifndef UINT16_MAX -#define UINT16_MAX 0xffffui16 -#endif -#ifndef UINT32_MAX -#define UINT32_MAX 0xffffffffui32 -#endif -#ifndef UINT64_MAX -#define UINT64_MAX 0xffffffffffffffffui64 -#endif - -#elif defined NN_HAVE_SOLARIS || defined NN_HAVE_OPENVMS - -/* Solaris and OpenVMS don't have standard stdint.h header, rather the fixed - integer types are defined in inttypes.h. */ -#include <inttypes.h> - -#else - -/* Fully POSIX-compliant platforms have fixed integer types defined - in stdint.h. */ -#include <stdint.h> - -#endif - -#endif - diff --git a/src/utils/stopwatch.h b/src/utils/stopwatch.h index b4d0860..6d09fa6 100644 --- a/src/utils/stopwatch.h +++ b/src/utils/stopwatch.h @@ -24,8 +24,9 @@ #ifndef NN_STOPWATCH_INCLUDED #define NN_STOPWATCH_INCLUDED +#include <stdint.h> + #include "err.h" -#include "int.h" /* Check whether measured time is the expected time (in microseconds). The upper tolerance is 50ms so that the test doesn't fail even on diff --git a/src/utils/wire.h b/src/utils/wire.h index 93c85db..69ac591 100644 --- a/src/utils/wire.h +++ b/src/utils/wire.h @@ -23,7 +23,7 @@ #ifndef NN_WIRE_INCLUDED #define NN_WIRE_INCLUDED -#include "int.h" +#include <stdint.h> uint16_t nn_gets (const uint8_t *buf); void nn_puts (uint8_t *buf, uint16_t val); |