Skip to content

Commit fc9696a

Browse files
committed
locale.c: Don't compile get_displayable_string if unused
This was generating warnings on several different platforms
1 parent 2f77b97 commit fc9696a

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

embed.fnc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,9 +3463,11 @@ SR |char * |my_setlocale_debug_string_i \
34633463
S |const char *|get_LC_ALL_display
34643464
# endif
34653465
# endif
3466+
# if defined(DEBUGGING) || defined(USE_POSIX_2008_LOCALE)
34663467
S |const char *|get_displayable_string|NN const char * const s \
34673468
|NN const char * const e \
34683469
|const bool is_utf8
3470+
# endif
34693471
#endif
34703472

34713473
#if defined(PERL_IN_UTIL_C)

embed.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,11 @@
16431643
# endif
16441644
# endif
16451645
# endif
1646+
# if defined(DEBUGGING) || defined(USE_POSIX_2008_LOCALE)
1647+
# if defined(PERL_IN_LOCALE_C)
1648+
#define get_displayable_string(a,b,c) S_get_displayable_string(aTHX_ a,b,c)
1649+
# endif
1650+
# endif
16461651
# if defined(DEBUG_LEAKING_SCALARS_FORK_DUMP)
16471652
#define dump_sv_child(a) Perl_dump_sv_child(aTHX_ a)
16481653
# endif
@@ -1748,7 +1753,6 @@
17481753
#define unshare_hek_or_pvn(a,b,c,d) S_unshare_hek_or_pvn(aTHX_ a,b,c,d)
17491754
# endif
17501755
# if defined(PERL_IN_LOCALE_C)
1751-
#define get_displayable_string(a,b,c) S_get_displayable_string(aTHX_ a,b,c)
17521756
# if defined(USE_LOCALE)
17531757
#define get_category_index S_get_category_index
17541758
#define get_locale_string_utf8ness_i(a,b,c,d) S_get_locale_string_utf8ness_i(aTHX_ a,b,c,d)

locale.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5954,6 +5954,7 @@ S_print_collxfrm_input_and_return(pTHX_
59545954

59555955
# endif /* DEBUGGING */
59565956
#endif /* USE_LOCALE_COLLATE */
5957+
#if defined(DEBUGGING) || defined(USE_POSIX_2008_LOCALE)
59575958

59585959
STATIC const char *
59595960
S_get_displayable_string(pTHX_
@@ -6007,6 +6008,7 @@ S_get_displayable_string(pTHX_
60076008
return ret;
60086009
}
60096010

6011+
#endif
60106012
#ifdef USE_LOCALE
60116013

60126014
STATIC const char *

proto.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5226,6 +5226,13 @@ STATIC const char * S_get_LC_ALL_display(pTHX);
52265226
# endif
52275227
# endif
52285228
#endif
5229+
#if defined(DEBUGGING) || defined(USE_POSIX_2008_LOCALE)
5230+
# if defined(PERL_IN_LOCALE_C)
5231+
STATIC const char * S_get_displayable_string(pTHX_ const char * const s, const char * const e, const bool is_utf8);
5232+
#define PERL_ARGS_ASSERT_GET_DISPLAYABLE_STRING \
5233+
assert(s); assert(e)
5234+
# endif
5235+
#endif
52295236
#if defined(DEBUG_LEAKING_SCALARS_FORK_DUMP)
52305237
PERL_CALLCONV void Perl_dump_sv_child(pTHX_ SV *sv)
52315238
__attribute__visibility__("hidden");
@@ -5698,9 +5705,6 @@ PERL_CALLCONV SV* Perl_hfree_next_entry(pTHX_ HV *hv, STRLEN *indexp)
56985705

56995706
#endif
57005707
#if defined(PERL_IN_LOCALE_C)
5701-
STATIC const char * S_get_displayable_string(pTHX_ const char * const s, const char * const e, const bool is_utf8);
5702-
#define PERL_ARGS_ASSERT_GET_DISPLAYABLE_STRING \
5703-
assert(s); assert(e)
57045708
# if defined(USE_LOCALE)
57055709
STATIC unsigned int S_get_category_index(const int category, const char * locale);
57065710
#define PERL_ARGS_ASSERT_GET_CATEGORY_INDEX

0 commit comments

Comments
 (0)