aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-03 01:21:20 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-03 01:21:20 +0000
commitce8d9b4a0d2c16ff2d634ce6c4b00a9156cc55f3 (patch)
tree72d1524d4893aab0378901ffde25e1e07d448c5c
parent378258bd0b5c98d9752fc2a3e259d7f5d6d7a653 (diff)
downloadruby-ce8d9b4a0d2c16ff2d634ce6c4b00a9156cc55f3.tar.gz
* configure.in, {bcc32,win32,wince}/Makefile.sub (HAVE_SNPRINTF,
HAVE_VSNPRINTF): use win32/win32.c's implementation instead of missing/vsnprintf.c's. * win32/win32.[ch] (rb_w32_snprintf, rb_w32_vsnprintf): reverted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--bcc32/Makefile.sub2
-rw-r--r--configure.in2
-rw-r--r--win32/Makefile.sub2
-rw-r--r--win32/win32.c20
-rw-r--r--win32/win32.h5
-rw-r--r--wince/Makefile.sub2
7 files changed, 41 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ee63ef37c..4f9c495aa0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Aug 3 10:13:52 2005 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * configure.in, {bcc32,win32,wince}/Makefile.sub (HAVE_SNPRINTF,
+ HAVE_VSNPRINTF): use win32/win32.c's implementation instead of
+ missing/vsnprintf.c's.
+
+ * win32/win32.[ch] (rb_w32_snprintf, rb_w32_vsnprintf): reverted.
+
Wed Aug 3 10:05:08 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: check vsnprintf() and snprintf().
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index 23faea9a3d..5b51846c77 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -252,6 +252,8 @@ $(CONFIG_H): $(MKFILES) $(srcdir)bcc32/Makefile.sub
\#define HAVE_STRTOD 1
\#define HAVE_STRTOL 1
\#define HAVE_STRTOUL 1
+\#define HAVE_SNPRINTF 1
+\#define HAVE_VSNPRINTF 1
\#define HAVE_ISNAN 1
\#define HAVE_FINITE 1
\#define HAVE_FMOD 1
diff --git a/configure.in b/configure.in
index 1f278a4a03..d6640845c2 100644
--- a/configure.in
+++ b/configure.in
@@ -353,6 +353,8 @@ mingw*) LIBS="-lshell32 -lws2_32 $LIBS"
ac_cv_func_times=yes
ac_cv_func_waitpid=yes
ac_cv_func_fsync=yes
+ ac_cv_func_snprintf=yes
+ ac_cv_func_vsnprintf=yes
ac_cv_func_seekdir=yes
ac_cv_func_telldir=yes
ac_cv_func_isinf=yes
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 385ac01522..89ec5cad37 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -248,6 +248,8 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_FLOCK 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
#define HAVE_ISNAN 1
#define HAVE_FINITE 1
#define HAVE_HYPOT 1
diff --git a/win32/win32.c b/win32/win32.c
index 02fbbdeb70..7345f3d2df 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3600,6 +3600,26 @@ rb_w32_utime(const char *path, struct utimbuf *times)
}
int
+rb_w32_vsnprintf(char *buf, size_t size, const char *format, va_list va)
+{
+ int ret = _vsnprintf(buf, size, format, va);
+ if (size > 0) buf[size - 1] = 0;
+ return ret;
+}
+
+int
+rb_w32_snprintf(char *buf, size_t size, const char *format, ...)
+{
+ int ret;
+ va_list va;
+
+ va_start(va, format);
+ ret = vsnprintf(buf, size, format, va);
+ va_end(va);
+ return ret;
+}
+
+int
rb_w32_mkdir(const char *path, int mode)
{
int ret = -1;
diff --git a/win32/win32.h b/win32/win32.h
index bb3acd7961..a347f04f7a 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -178,6 +178,11 @@ extern int rb_w32_rename(const char *, const char *);
extern char **rb_w32_get_environ(void);
extern void rb_w32_free_environ(char **);
+#define vsnprintf(s,n,f,l) rb_w32_vsnprintf(s,n,f,l)
+#define snprintf rb_w32_snprintf
+extern int rb_w32_vsnprintf(char *, size_t, const char *, va_list);
+extern int rb_w32_snprintf(char *, size_t, const char *, ...);
+
extern int chown(const char *, int, int);
extern int link(const char *, const char *);
extern int gettimeofday(struct timeval *, struct timezone *);
diff --git a/wince/Makefile.sub b/wince/Makefile.sub
index 609d45d4a1..d2639c9152 100644
--- a/wince/Makefile.sub
+++ b/wince/Makefile.sub
@@ -250,6 +250,8 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/wince/Makefile.sub
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_FLOCK 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
#define HAVE_FINITE 1
#define HAVE_HYPOT 1
#define HAVE_FMOD 1