reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
compat.hxx File Reference

This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platforms. More...

#include <cstring>
#include <string>
#include <netdb.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <pthread.h>
#include <limits.h>

Go to the source code of this file.

Namespaces

namespace  resip
 dcm! – add UnusedChecking(_enum) below;
 

Macros

#define GPERF_SIZE_TYPE   size_t
 
#define RESIP_LAMBDA_CAPTURE_ALL_AND_THIS   =
 Lambda capture default that also captures 'this'.
 
#define RESIP_MAX_SOCKADDR_SIZE   28
 
#define T_NAPTR   35
 
#define T_SRV   33
 
#define T_AAAA   28
 
#define T_A   1
 
#define REASONABLE_TEMPLATES
 
#define IPPROTO_SCTP   132
 
#define RESIP_DEPRECATED(x)   x
 
#define _TRUNCATE   -1
 
#define SNPRINTF_1(buffer, sizeofBuffer, count, format, var1)   snprintf(buffer,sizeofBuffer,format,var1)
 
#define LTOA(l, buffer, bufferlen, radix)   SNPRINTF_1(buffer,bufferlen,bufferlen,"%li",l)
 
#define ULTOA(ul, buffer, bufferlen, radix)   SNPRINTF_1(buffer,bufferlen,bufferlen,"%lu",ul)
 
#define I64TOA(value, string, sizeofstring, radix)   SNPRINTF_1(string,sizeofstring,sizeofstring,"%lli",value)
 
#define UI64TOA(value, string, sizeofstring, radix)   SNPRINTF_1(string,sizeofstring,sizeofstring,"%llu",value)
 
#define GCVT(f, sigdigits, buffer, bufferlen)   SNPRINTF_1(buffer,bufferlen,bufferlen,"%f",f)
 
#define _CVTBUFSIZE   309+40
 

Functions

template<typename _Tp >
const _Tp & resip::resipMin (const _Tp &__a, const _Tp &__b)
 
template<typename _Tp >
const _Tp & resip::resipMax (const _Tp &__a, const _Tp &__b)
 
template<typename _Tp1 , typename _Tp2 >
const _Tp1 resip::resipIntDiv (const _Tp1 &__a, const _Tp2 &__b)
 
uint64_t resip::ntoh64 (const uint64_t input)
 
uint64_t resip::hton64 (const uint64_t input)
 
const char * resip::strErrorResult (char *result, char *)
 
const char * resip::strErrorResult (int result, char *buf)
 
std::string resip::strError (int err)
 

Detailed Description

This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platforms.

Definition in file compat.hxx.

Macro Definition Documentation

◆ _CVTBUFSIZE

#define _CVTBUFSIZE   309+40

Definition at line 365 of file compat.hxx.

◆ _TRUNCATE

#define _TRUNCATE   -1

Definition at line 358 of file compat.hxx.

◆ GCVT

#define GCVT (   f,
  sigdigits,
  buffer,
  bufferlen 
)    SNPRINTF_1(buffer,bufferlen,bufferlen,"%f",f)

Definition at line 364 of file compat.hxx.

◆ GPERF_SIZE_TYPE

#define GPERF_SIZE_TYPE   size_t

Definition at line 7 of file compat.hxx.

◆ I64TOA

#define I64TOA (   value,
  string,
  sizeofstring,
  radix 
)    SNPRINTF_1(string,sizeofstring,sizeofstring,"%lli",value)

Definition at line 362 of file compat.hxx.

◆ IPPROTO_SCTP

#define IPPROTO_SCTP   132

Definition at line 322 of file compat.hxx.

◆ LTOA

#define LTOA (   l,
  buffer,
  bufferlen,
  radix 
)    SNPRINTF_1(buffer,bufferlen,bufferlen,"%li",l)

Definition at line 360 of file compat.hxx.

◆ REASONABLE_TEMPLATES

#define REASONABLE_TEMPLATES

Definition at line 295 of file compat.hxx.

◆ RESIP_DEPRECATED

#define RESIP_DEPRECATED (   x)    x

Definition at line 334 of file compat.hxx.

◆ RESIP_LAMBDA_CAPTURE_ALL_AND_THIS

#define RESIP_LAMBDA_CAPTURE_ALL_AND_THIS   =

Lambda capture default that also captures 'this'.

A plain '[=]' capture-default implicitly captures 'this', which is deprecated in C++20, while spelling it '[=, this]' is a C++20 extension that warns under earlier standards. RESIP_LAMBDA_CAPTURE_ALL_AND_THIS expands to whichever form is well-formed and warning-free for the language version in use, so the same source compiles cleanly from C++11 through C++20 and later. (_MSVC_LANG is checked because MSVC reports the real standard there rather than in __cplusplus unless /Zc:__cplusplus is set.)

Usage: [RESIP_LAMBDA_CAPTURE_ALL_AND_THIS]() { ...uses this and locals... }

Definition at line 37 of file compat.hxx.

◆ RESIP_MAX_SOCKADDR_SIZE

#define RESIP_MAX_SOCKADDR_SIZE   28

Definition at line 107 of file compat.hxx.

◆ SNPRINTF_1

#define SNPRINTF_1 (   buffer,
  sizeofBuffer,
  count,
  format,
  var1 
)    snprintf(buffer,sizeofBuffer,format,var1)

Definition at line 359 of file compat.hxx.

◆ T_A

#define T_A   1

Definition at line 152 of file compat.hxx.

◆ T_AAAA

#define T_AAAA   28

Definition at line 148 of file compat.hxx.

◆ T_NAPTR

#define T_NAPTR   35

Definition at line 140 of file compat.hxx.

◆ T_SRV

#define T_SRV   33

Definition at line 144 of file compat.hxx.

◆ UI64TOA

#define UI64TOA (   value,
  string,
  sizeofstring,
  radix 
)    SNPRINTF_1(string,sizeofstring,sizeofstring,"%llu",value)

Definition at line 363 of file compat.hxx.

◆ ULTOA

#define ULTOA (   ul,
  buffer,
  bufferlen,
  radix 
)    SNPRINTF_1(buffer,bufferlen,bufferlen,"%lu",ul)

Definition at line 361 of file compat.hxx.