cisco / libsrtp

Library for SRTP (Secure Realtime Transport Protocol)
Other
1.21k stars 474 forks source link

Fix UWP build #513

Closed hanseuljun closed 3 years ago

hanseuljun commented 3 years ago

UWP, an application framework from Microsoft for Windows, aims higher in terms of security. And as a result, unfortunately, they thought of turning warnings into errors and introducing some safer functions that are not portable.

This pull request removes two obstacles in front of building the current version in UWP

  1. UWP finds usage of uninitialized local pointers as evil, reporting errors upon them. This is quite reasonable and has an easy fix of initializing the pointers as NULL, so I've done this to about three of them.
  2. UWP thinks using sscanf is wrong and suggests using sscanf_s intsead, which I would not agree if I am in charge of maintaining a portable library. Defining _CRT_SECURE_NO_WARNINGS tells UWP to stop talk about this, so I have added this definition. I added it as a public one of srtp2, so it can spread through the project.

image