• R/O
  • SSH
  • HTTPS

yash: 提交


Commit MetaInfo

修訂4181 (tree)
時間2021-12-18 15:34:45
作者magicant

Log Message

configure: Check for strdup & wcsdup safely

Change Summary

差異

--- yash/trunk/configure (revision 4180)
+++ yash/trunk/configure (revision 4181)
@@ -857,6 +857,7 @@
857857 checking 'for strdup'
858858 cat >"${tempsrc}" <<END
859859 ${confighdefs}
860+#include <stdlib.h>
860861 #include <string.h>
861862 #ifndef strdup
862863 char *strdup(const char*);
@@ -897,14 +898,15 @@
897898 checking 'for wcsdup'
898899 cat >"${tempsrc}" <<END
899900 ${confighdefs}
901+#include <stdlib.h>
900902 #include <wchar.h>
901903 #ifndef wcsdup
902904 wchar_t *wcsdup(const wchar_t*);
903905 #endif
904906 int main(void) {
905- char *dup = wcsdup("12345");
907+ wchar_t *dup = wcsdup(L"12345");
906908 if (!dup) return 1;
907- int cmp = wcscmp(dup, "12345");
909+ int cmp = wcscmp(dup, L"12345");
908910 free(dup);
909911 return cmp != 0;
910912 }
Show on old repository browser