6 #include <emscripten.h>
10 #define PGNR_API __declspec(dllexport)
11 #elif defined(__GNUC__)
12 #define PGNR_API __attribute__((visibility("default")))
18 #define PGNR_KEEPALIVE EMSCRIPTEN_KEEPALIVE
20 #define PGNR_KEEPALIVE
27 typedef int32_t PGNRResult;
30 PGNR_RESULT_SENT_RELIABLY = 1,
31 PGNR_RESULT_TCP_ONLY = 2,
33 PGNR_RESULT_ERROR = -1,
34 PGNR_RESULT_FAILED_TO_LISTEN = -2,
35 PGNR_RESULT_SSL_FAILURE = -3,
36 PGNR_RESULT_ALREADY_CLOSED = -4,
37 PGNR_RESULT_ONLY_SECURELY = -5
45 bool pgnr_result_is_error(PGNRResult result) {
49 typedef int32_t PGNRSendMode;
51 PGNR_SEND_MODE_UNRELIABLE = 0,
52 PGNR_SEND_MODE_RELIABLE_ORDERED = 1,