Skip to content

Commit 455e4e0

Browse files
rgommersnoatamir
authored andcommitted
Fix build warning for use of strdup in ultrajson (pandas-dev#48369)
1 parent a1a2580 commit 455e4e0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pandas/_libs/src/headers/portable.h

+8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#ifndef _PANDAS_PORTABLE_H_
22
#define _PANDAS_PORTABLE_H_
33

4+
// To get `strdup` from strings.h
5+
#ifndef _XOPEN_SOURCE
6+
#define _XOPEN_SOURCE 600
7+
#endif
8+
9+
#include <string.h>
10+
411
#if defined(_MSC_VER)
512
#define strcasecmp( s1, s2 ) _stricmp( s1, s2 )
13+
#define strdup _strdup
614
#endif
715

816
// GH-23516 - works around locale perf issues

pandas/_libs/src/ujson/lib/ultrajson.h

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ tree doesn't have cyclic references.
5454

5555
#include <stdio.h>
5656
#include <wchar.h>
57+
#include "../../headers/portable.h"
5758

5859
// Don't output any extra whitespaces when encoding
5960
#define JSON_NO_EXTRA_WHITESPACE

0 commit comments

Comments
 (0)