Many platforms with 4 byte integers define RAND_MAX as INT_MAX but some (Solaris and derivatives for example), RAND_MAX is only 32767 but INT_MAX is 2147483647. This change allows falling back to the posix random() and srandom() variants with casts to int if both int and long are 4 bytes, then defining a consistent KAM_RAND_MAX of 2147483647. If both INT_MAX and RAND_MAX are 2 bytes, then we are stuck with ANSI rand().
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/701
Commit Summary
- core: add portable rand() macros
- ims_charging: update to use kam_rand()
- auth: update to use kam_rand()
- carrierroute: update to use kam_rand()
- cdp: update to use kam_rand()
- cfgutils: update to use kam_rand()
- dialog: update to use kam_rand()
- dispatcher: update to use kam_rand()
- drouting: update to use kam_rand()
- ims_auth: update to use kam_rand()
- ims_dialog: update to use kam_rand()
- ims_registrar_scscf: update to use kam_rand()
- iptrtpproxy: update to use kam_rand()
- lcr: update to use kam_rand()
- nat_traversal: update to use kam_rand()
- nsq: update to use kam_rand()
- pipelimit: update to use kam_rand()
- presence: update to use kam_rand()
- registrar: update to use kam_rand()
- rls: update to use kam_rand()
- sipcapture: update to use kam_rand()
- tm: update to use kam_rand()
- tsilo: update to use kam_rand()
- usrloc: update to use kam_rand()
- xmpp: update to use kam_rand()
- xprint: update to use kam_rand()
- core: update to use kam_rand()
File Changes
Patch Links:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.