This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Added several missing PERL_UNUSED_RESULT()
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index d6d9407..3fa7db5 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -879,6 +879,11 @@ EXTERN_C int usleep(unsigned int);
 #   define STRUCT_OFFSET(s,m)  (Size_t)(&(((s *)0)->m))
 #endif
 
+/* ptrdiff_t is C11, so undef it under pedantic builds */
+#ifdef PERL_GCC_PEDANTIC
+#   undef HAS_PTRDIFF_T
+#endif
+
 #ifndef __SYMBIAN32__
 #  if defined(I_STRING) || defined(__cplusplus)
 #     include <string.h>
@@ -916,7 +921,7 @@ EXTERN_C int usleep(unsigned int);
 #  define CHECK_MALLOC_TAINT(newval)                           \
        CHECK_MALLOC_TOO_LATE_FOR_(                             \
                if (newval) {                                   \
-                 panic_write2("panic: tainting with $ENV{PERL_MALLOC_OPT}\n");\
+                 PERL_UNUSED_RESULT(panic_write2("panic: tainting with $ENV{PERL_MALLOC_OPT}\n"));\
                  exit(1); })
 #  define MALLOC_CHECK_TAINT(argc,argv,env)    STMT_START {    \
        if (doing_taint(argc,argv,env)) {                       \
@@ -5276,6 +5281,7 @@ typedef struct am_table_short AMTS;
 #define PERLDB_SAVESRC_NOSUBS  (PL_perldb && (PL_perldb & PERLDBf_SAVESRC_NOSUBS))
 #define PERLDB_SAVESRC_INVALID (PL_perldb && (PL_perldb & PERLDBf_SAVESRC_INVALID))
 
+#ifdef USE_LOCALE
 /* These locale things are all subject to change */
 /* Returns TRUE if the plain locale pragma without a parameter is in effect
  */
@@ -5305,6 +5311,22 @@ typedef struct am_table_short AMTS;
 #define IN_LC_RUNTIME(category)         (IN_LC_ALL_RUNTIME || (IN_LC_PARTIAL_RUNTIME && _is_in_locale_category(FALSE, (category))))
 #define IN_LC(category)                 (IN_LC_COMPILETIME(category) || IN_LC_RUNTIME(category))
 
+#else   /* No locale usage */
+#   define IN_LOCALE_RUNTIME                0
+#   define IN_SOME_LOCALE_FORM_RUNTIME      0
+#   define IN_LOCALE_COMPILETIME            0
+#   define IN_SOME_LOCALE_FORM_COMPILETIME  0
+#   define IN_LOCALE                        0
+#   define IN_SOME_LOCALE_FORM              0
+#   define IN_LC_ALL_COMPILETIME            0
+#   define IN_LC_ALL_RUNTIME                0
+#   define IN_LC_PARTIAL_COMPILETIME        0
+#   define IN_LC_PARTIAL_RUNTIME            0
+#   define IN_LC_COMPILETIME(category)      0
+#   define IN_LC_RUNTIME(category)          0
+#   define IN_LC(category)                  0
+#endif
+
 #ifdef USE_LOCALE_NUMERIC
 
 /* These macros are for toggling between the underlying locale (LOCAL) and the
@@ -5411,10 +5433,10 @@ typedef struct am_table_short AMTS;
 #define STORE_LC_NUMERIC_SET_TO_NEEDED()
 #define DECLARE_STORE_LC_NUMERIC_SET_TO_NEEDED()
 #define RESTORE_LC_NUMERIC()
+#define LOCK_NUMERIC_STANDARD()
+#define UNLOCK_NUMERIC_STANDARD()
 
 #define Atof                           my_atof
-#define IN_LOCALE_RUNTIME              0
-#define IN_LOCALE_COMPILETIME          0
 
 #endif /* !USE_LOCALE_NUMERIC */
 
@@ -5860,16 +5882,6 @@ extern void moncontrol(int);
 #define PERL_PV_PRETTY_DUMP  PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
 #define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII
 
-#if defined(USE_C_BACKTRACE) && defined(I_BFD)
-#  define USE_BFD
-#  ifdef PERL_DARWIN
-#    undef USE_BFD /* BFD is useless in OS X. */
-#  endif
-#  ifdef USE_BFD
-#    include <bfd.h>
-#  endif
-#endif
-
 /*
 
    (KEEP THIS LAST IN perl.h!)