The ENet shim

1. The ENet shim

cc -include ngnet/enet.h $(pkg-config --cflags ngnet) -c server.c
cc server.o ... $(pkg-config --libs ngnet)

-include puts macros after ENet’s header that redirect enet_host_create, enet_host_destroy, enet_host_service, enet_host_check_events, enet_host_broadcast, enet_host_flush, enet_host_connect, enet_peer_send, enet_peer_disconnect, enet_peer_disconnect_now, enet_peer_disconnect_later, enet_peer_reset, enet_peer_timeout and enet_peer_ping to ngnet_* wrappers with the same signatures. The program’s ENet code is unchanged. What the wrappers add:

ENet header selection: NGNET_ENET_HEADER (default <enet/enet.h>); define NGNET_ENET6 for enet6, whose enet_host_create takes an address type first.