Revision 58b9ee41

View differences:

mongoose.c
13727 13727

  
13728 13728
#include <lwip/pbuf.h>
13729 13729
#include <lwip/tcp.h>
13730
#if CS_PLATFORM != CS_P_STM32
13730 13731
#include <lwip/tcp_impl.h>
13732
#endif
13731 13733
#include <lwip/udp.h>
13732 13734

  
13733 13735
/* Amalgamated: #include "common/cs_dbg.h" */
......
13949 13951
 * Lwip included in the SDKs for nRF5x chips has different type for the
13950 13952
 * callback of `udp_recv()`
13951 13953
 */
13952
#if CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52
13954
#if CS_PLATFORM == CS_P_NRF51 || CS_PLATFORM == CS_P_NRF52 || \
13955
    CS_PLATFORM == CS_P_STM32
13953 13956
static void mg_lwip_udp_recv_cb(void *arg, struct udp_pcb *pcb, struct pbuf *p,
13954 13957
                                const ip_addr_t *addr, u16_t port)
13955 13958
#else
mongoose.h
1532 1532
#define CS_COMMON_PLATFORMS_PLATFORM_STM32_H_
1533 1533
#if CS_PLATFORM == CS_P_STM32
1534 1534

  
1535
#include <sys/types.h>
1535 1536
#include <stdint.h>
1537
#include <inttypes.h>
1536 1538
#include <stdio.h>
1537 1539
#include <ctype.h>
1538 1540
#include <errno.h>
1539 1541
#include <memory.h>
1540 1542

  
1541
/*
1542
 * Fake declarations to get c_hello compiling w/out network
1543
 * TODO(alashkin): remove this during working on stm32/cude networking
1544
 */
1545

  
1546
typedef int sock_t;
1547

  
1548
struct in_addr{
1549
  int s_addr;
1550
};
1551

  
1552
struct sockaddr {
1553
  int sa_family;
1554
};
1555

  
1556
struct sockaddr_in {
1557
  int sin_family;
1558
  int sin_port;
1559
  struct in_addr sin_addr;
1560
};
1561

  
1562
#define INVALID_SOCKET -1
1563
#define SOCK_DGRAM -1
1564
#define SOCK_STREAM -1
1565
#define AF_INET -1
1566

  
1567 1543
#define to64(x) strtoll(x, NULL, 10)
1568

  
1569
#define INT64_FMT "ld"
1544
#define INT64_FMT PRId64
1570 1545
#define SIZE_T_FMT "u"
1571 1546

  
1572
#define htonl(x) (x)
1573
#define htons(x) (x)
1574
#define ntohs(x) (x)
1575
#define ntohl(x) (x)
1576

  
1577
#define F_GETFL -1
1578
#define F_SETFL -1
1579
#define O_NONBLOCK -1
1580
#define fcntl(x1, x2, x3) (-1)
1581
#define socket(x1, x2, x3) (-1)
1582
#define connect(x1, x2, x3) (-1)
1583
#define setsockopt(x1, x2, x3, x4, x5) (-1)
1584
#define closesocket(x)
1585
typedef int socklen_t;
1586
#define accept(x1, x2, x3) (-1)
1587
#define SOMAXCONN -1
1588
#define listen(x1, x2) (-1)
1589
#define bind(x1, x2, x3) (-1)
1590
#define getsockname(x1, x2, x3) (-1)
1591
#define sendto(x1, x2, x3, x4, x5, x6) (-1)
1592
#define send(x1, x2, x3, x4) (-1)
1593
#define recvfrom(x1, x2, x3, x4, x5, x6) (-1)
1594
#define getsockopt(x1, x2, x3, x4, x5) (-1)
1595
#define getpeername(x1, x2, x3) (-1)
1596
#define recv(s, b, l, f) (-1)
1597
#define select(x1, x2, x3, x4, x5) (0)
1598

  
1599
const char *inet_ntop(int af, const void *src, char *dst, int size);
1600

  
1601 1547
#endif /* CS_PLATFORM == CS_P_STM32 */
1602 1548
#endif /* CS_COMMON_PLATFORMS_PLATFORM_STM32_H_ */
1603 1549
#ifdef MG_MODULE_LINES

Also available in: Unified diff