// Name: wx/wxcrt.h
// Purpose: Type-safe ANSI and Unicode builds compatible wrappers for
// CRT functions
-// Author: Joel Farley, Ove Kåven
+// Author: Joel Farley, Ove K�ven
// Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee, Vaclav Slavik
// Created: 1998/06/12
// RCS-ID: $Id$
inline int wxRename(const wxString& oldpath, const wxString& newpath)
{ return wxCRT_Rename(oldpath.fn_str(), newpath.fn_str()); }
-// NB: we don't provide wxString/wxCStrData versions of wxTmpnam, because 's'
-// is writable
-inline char *wxTmpnam(char *s)
- { return wxCRT_TmpnamA(s); }
-inline wchar_t *wxTmpnam(wchar_t *s)
- { return wxCRT_TmpnamW(s); }
-
extern WXDLLIMPEXP_BASE int wxPuts(const wxString& s);
extern WXDLLIMPEXP_BASE int wxFputs(const wxString& s, FILE *stream);
extern WXDLLIMPEXP_BASE void wxPerror(const wxString& s);
* Name: wx/wxcrtbase.h
* Purpose: Type-safe ANSI and Unicode builds compatible wrappers for
* CRT functions
- * Author: Joel Farley, Ove Kåven
+ * Author: Joel Farley, Ove K�ven
* Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee
* Created: 1998/06/12
* RCS-ID: $Id$
WXDLLIMPEXP_BASE int wxCRT_FputcW(wchar_t wc, FILE *stream);
#endif
-#define wxCRT_TmpnamA tmpnam
-#ifdef _ttmpnam
- #define wxCRT_TmpnamW _wtmpnam
-#endif
-
-#ifndef wxCRT_TmpnamW
-WXDLLIMPEXP_BASE wchar_t *wxCRT_TmpnamW(wchar_t *s);
-#endif
+/*
+ NB: tmpnam() is unsafe and thus is not wrapped!
+ Use other wxWidgets facilities instead:
+ wxFileName::CreateTempFileName, wxTempFile, or wxTempFileOutputStream
+*/
+#define wxTmpnam(x) wxTmpnam_is_insecure_use_wxTempFile_instead
#define wxCRT_PerrorA perror
#ifdef wxHAVE_TCHAR_SUPPORT
}
#endif
-#ifndef wxCRT_TmpnamW
-wchar_t *wxCRT_TmpnamW(wchar_t *s)
-{
- // tmpnam_r() returns NULL if s=NULL, do the same
- wxCHECK_MSG( s, NULL, "wxTmpnam must be called with a buffer" );
-
-#ifndef L_tmpnam
- #define L_tmpnam 1024
-#endif
- wxCharBuffer buf(L_tmpnam);
- tmpnam(buf.data());
-
- wxConvLibc.ToWChar(s, L_tmpnam+1, buf.data());
- return s;
-}
-#endif // !wxCRT_TmpnamW
// ============================================================================