Simplifies a few preprocessor directives

This commit is contained in:
kkrentz authored and mrdeep1 committed 2022-10-12 17:21:20 +01:00
1 parent c5c4f9bf1d
commit dc66470a1a
2 files changed
-12

No files matched your search

-2
View File
@@ -187,12 +187,10 @@ coap_socket_bind_udp(coap_socket_t *sock,
"coap_socket_bind_udp: ioctl FIONBIO: %s\n", coap_socket_strerror());
}
#ifndef RIOT_VERSION
if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEADDR, OPTVAL_T(&on), sizeof(on)) == COAP_SOCKET_ERROR)
coap_log(LOG_WARNING,
"coap_socket_bind_udp: setsockopt SO_REUSEADDR: %s\n",
coap_socket_strerror());
#endif /* RIOT_VERSION */
switch (listen_addr->addr.sa.sa_family) {
case AF_INET:
-10
View File
@@ -495,12 +495,7 @@ coap_delete_attr(coap_attr_t *attr) {
coap_delete_str_const(attr->value);
}
#ifdef WITH_LWIP
memp_free(MEMP_COAP_RESOURCEATTR, attr);
#endif
#ifndef WITH_LWIP
coap_free_type(COAP_RESOURCEATTR, attr);
#endif
}
typedef enum coap_deleting_resource_t {
@@ -546,12 +541,7 @@ coap_free_resource(coap_resource_t *resource) {
coap_free(resource->proxy_name_list);
}
#ifdef WITH_LWIP
memp_free(MEMP_COAP_RESOURCE, resource);
#endif
#ifndef WITH_LWIP
coap_free_type(COAP_RESOURCE, resource);
#endif /* WITH_CONTIKI */
}
void