win32_freeenvironmentstrings was added in commit
4f46e52b008. It is not
documented as public api but is exported. Since it is nothing more than a
renaming of win32_free, replace it with a macro to win32_free. This saves
an entry in the export table, and the string name of the export from
perl517.dll. Also see
http://www.nntp.perl.org/group/perl.perl5.porters/2012/09/msg192954.html
return name;
}
+/* the returned string must be freed with win32_freeenvironmentstrings which is
+ * implemented as a macro
+ * void win32_freeenvironmentstrings(void* block)
+ */
DllExport char *
win32_getenvironmentstrings(void)
{
return(lpStr);
}
-DllExport void
-win32_freeenvironmentstrings(void* block)
-{
- win32_free(block);
-}
-
DllExport char *
win32_getenv(const char *name)
{
DllExport DIR* win32_dirp_dup(DIR *const dirp, CLONE_PARAMS *const param);
DllExport char* win32_getenvironmentstrings(void);
-DllExport void win32_freeenvironmentstrings(void *block);
+/* also see win32_freeenvironmentstrings macro */
DllExport char* win32_getenv(const char *name);
DllExport int win32_putenv(const char *name);
END_EXTERN_C
+/* see comment in win32_getenvironmentstrings */
+#define win32_freeenvironmentstrings(x) win32_free(x)
#undef alarm
#define alarm win32_alarm
#undef strerror