mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-05 20:02:19 +03:00
Add visual studio 2015 solution and project files for building libcoap on windows.
Merge changes from PR #47 related to windows platform support. Add full windows platform support including correct error checking and working regression tests and examples. Remove need to build applications using libcoap with -DWITH_POSIX and to include coap_config.h. This applies to the examples as well.
This commit is contained in:
1 parent
771f013b6e
commit
9b647d5d05
50 files changed
+2025
-257
No files matched your search
+6
-6
@@ -28,9 +28,9 @@
|
||||
*
|
||||
* @return @c -1 if @p bit does not fit into @p vec, @c 1 otherwise.
|
||||
*/
|
||||
inline static int
|
||||
COAP_STATIC_INLINE int
|
||||
bits_setb(uint8_t *vec, size_t size, uint8_t bit) {
|
||||
if (size <= (bit >> 3))
|
||||
if (size <= ((size_t)bit >> 3))
|
||||
return -1;
|
||||
|
||||
*(vec + (bit >> 3)) |= (uint8_t)(1 << (bit & 0x07));
|
||||
@@ -48,9 +48,9 @@ bits_setb(uint8_t *vec, size_t size, uint8_t bit) {
|
||||
*
|
||||
* @return @c -1 if @p bit does not fit into @p vec, @c 1 otherwise.
|
||||
*/
|
||||
inline static int
|
||||
COAP_STATIC_INLINE int
|
||||
bits_clrb(uint8_t *vec, size_t size, uint8_t bit) {
|
||||
if (size <= (bit >> 3))
|
||||
if (size <= ((size_t)bit >> 3))
|
||||
return -1;
|
||||
|
||||
*(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07)));
|
||||
@@ -67,9 +67,9 @@ bits_clrb(uint8_t *vec, size_t size, uint8_t bit) {
|
||||
*
|
||||
* @return @c 1 if the bit is set, @c 0 otherwise.
|
||||
*/
|
||||
inline static int
|
||||
COAP_STATIC_INLINE int
|
||||
bits_getb(const uint8_t *vec, size_t size, uint8_t bit) {
|
||||
if (size <= (bit >> 3))
|
||||
if (size <= ((size_t)bit >> 3))
|
||||
return -1;
|
||||
|
||||
return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0;
|
||||
|
||||
Reference in new issue
Block a user