forked from CESNET/UltraGrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved strdupa from compat/misc to strings
\+ missing include guard
- Loading branch information
1 parent
f01e4c3
commit e494106
Showing
10 changed files
with
21 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @file compat/strings.h | ||
* @author Martin Pulec <[email protected]> | ||
* | ||
* compatibility header for strcasecmp. strerror_s | ||
* compatibility header for strcasecmp. strdup, strerror_s | ||
*/ | ||
/* | ||
* Copyright (c) 2024 CESNET | ||
|
@@ -37,9 +37,13 @@ | |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#ifndef COMPAT_STRINGS_H_D54CAFC8_A1A0_4FF5_80A0_91F34FB11E12 | ||
#define COMPAT_STRINGS_H_D54CAFC8_A1A0_4FF5_80A0_91F34FB11E12 | ||
|
||
#include <string.h> | ||
|
||
#ifdef _WIN32 | ||
#ifndef strcasecmp | ||
#include <string.h> | ||
#define strcasecmp _stricmp | ||
#endif | ||
#else // ! defined _WIN32 | ||
|
@@ -64,5 +68,12 @@ COMPAT_MISC_EXT_C int __xpg_strerror_r(int errcode, char *buffer, size_t length) | |
#endif // ! defined __STDC_LIB_EXT1__ | ||
#endif // ! defined _WIN32 | ||
|
||
// strdupa is defined as a macro | ||
#include <string.h> | ||
#ifndef strdupa | ||
#define strdupa(s) (char *) memcpy(alloca(strlen(s) + 1), s, strlen(s) + 1) | ||
#endif // defined strdupa | ||
|
||
#undef COMPAT_MISC_EXT_C | ||
|
||
#endif // ! defined COMPAT_STRINGS_H_D54CAFC8_A1A0_4FF5_80A0_91F34FB11E12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters