Skip to content

Commit

Permalink
Fix build warning for use of strdup in ultrajson (pandas-dev#48369)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers authored and phofl committed Sep 22, 2022
1 parent 186a3d0 commit b3e977f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/_libs/src/headers/portable.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#ifndef _PANDAS_PORTABLE_H_
#define _PANDAS_PORTABLE_H_

// To get `strdup` from strings.h
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif

#include <string.h>

#if defined(_MSC_VER)
#define strcasecmp( s1, s2 ) _stricmp( s1, s2 )
#define strdup _strdup
#endif

// GH-23516 - works around locale perf issues
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/src/ujson/lib/ultrajson.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tree doesn't have cyclic references.

#include <stdio.h>
#include <wchar.h>
#include "../../headers/portable.h"

// Don't output any extra whitespaces when encoding
#define JSON_NO_EXTRA_WHITESPACE
Expand Down

0 comments on commit b3e977f

Please sign in to comment.