Navigation Menu

Skip to content

Commit

Permalink
win32: use _mkdir instead of mkdir on windows
Browse files Browse the repository at this point in the history
refs #1496

This POSIX function is deprecated beginning in Visual C++ 2005. Use the ISO C++ conformant _mkdir instead.
See: http://msdn.microsoft.com/en-US/library/ms235326%28v=vs.80%29.aspx
  • Loading branch information
kenhys committed Oct 4, 2012
1 parent 44b84b6 commit 7d39b30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ha_mroonga.cpp
Expand Up @@ -41,9 +41,12 @@
#ifndef WIN32
# include <dirent.h>
# include <unistd.h>
#define MRN_MKDIR(pathname, mode) mkdir((pathname), (mode))
#else
# include <math.h>
inline double round(double x) { return (floor(x + 0.5)); }
# include <direct.h>
#define MRN_MKDIR(pathname, mode) _mkdir((pathname))
#endif

#include "mrn_err.h"
Expand Down Expand Up @@ -7441,7 +7444,7 @@ void ha_mroonga::mkdir_p(const char *directory)
if (stat(sub_directory, &directory_status) != 0) {
DBUG_PRINT("info", ("mroonga: creating directory: <%s>", sub_directory));
GRN_LOG(ctx, GRN_LOG_INFO, "creating directory: <%s>", sub_directory);
if (mkdir(sub_directory, S_IRWXU) == 0) {
if (MRN_MKDIR(sub_directory, S_IRWXU) == 0) {
DBUG_PRINT("info",
("mroonga: created directory: <%s>", sub_directory));
GRN_LOG(ctx, GRN_LOG_INFO, "created directory: <%s>", sub_directory);
Expand Down

0 comments on commit 7d39b30

Please sign in to comment.