* dln.c (init_funcname_len): remove MAXPATHLEN dependency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
34558b71c7
commit
0cf319ce54
@ -44,6 +44,10 @@ Wed Nov 27 06:43:26 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
|||||||
|
|
||||||
* eval.c (rb_thread_start_0): initialize SystemExit properly.
|
* eval.c (rb_thread_start_0): initialize SystemExit properly.
|
||||||
|
|
||||||
|
Tue Nov 26 10:17:04 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* dln.c (init_funcname_len): remove MAXPATHLEN dependency.
|
||||||
|
|
||||||
Mon Nov 25 19:55:38 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
Mon Nov 25 19:55:38 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb (extmake): return true if not dynamic and not static.
|
* ext/extmk.rb (extmake): return true if not dynamic and not static.
|
||||||
|
24
dln.c
24
dln.c
@ -61,6 +61,9 @@ void *xrealloc();
|
|||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MAXPATHLEN
|
||||||
|
# define MAXPATHLEN 1024
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
@ -107,6 +110,7 @@ init_funcname_len(buf, file)
|
|||||||
char *file;
|
char *file;
|
||||||
{
|
{
|
||||||
char *p, *slash;
|
char *p, *slash;
|
||||||
|
int len;
|
||||||
|
|
||||||
/* Load the file as an object one */
|
/* Load the file as an object one */
|
||||||
for (p = file, slash = p-1; *p; p++) /* Find position of last '/' */
|
for (p = file, slash = p-1; *p; p++) /* Find position of last '/' */
|
||||||
@ -116,14 +120,9 @@ init_funcname_len(buf, file)
|
|||||||
if (*p == '/') slash = p;
|
if (*p == '/') slash = p;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This assumes that systems without length limitation for file names
|
len = strlen(FUNCNAME_PATTERN) + strlen(slash + 1);
|
||||||
provide asprintf(). This shouldn't be too unlikely. */
|
*buf = xmalloc(len);
|
||||||
#ifdef MAXPATHLEN
|
snprintf(*buf, len, FUNCNAME_PATTERN, slash + 1);
|
||||||
*buf = xmalloc(MAXPATHLEN);
|
|
||||||
snprintf(*buf, MAXPATHLEN, FUNCNAME_PATTERN, slash + 1);
|
|
||||||
#else
|
|
||||||
asprintf(buf, FUNCNAME_PATTERN, slash + 1);
|
|
||||||
#endif
|
|
||||||
for (p = *buf; *p; p++) { /* Delete suffix if it exists */
|
for (p = *buf; *p; p++) { /* Delete suffix if it exists */
|
||||||
if (*p == '.') {
|
if (*p == '.') {
|
||||||
*p = '\0'; break;
|
*p = '\0'; break;
|
||||||
@ -352,10 +351,6 @@ sym_hash(hdrp, syms)
|
|||||||
return tbl;
|
return tbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
|
||||||
# define MAXPATHLEN 1024
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dln_init(prog)
|
dln_init(prog)
|
||||||
const char *prog;
|
const char *prog;
|
||||||
@ -1263,11 +1258,6 @@ dln_load(file)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined _WIN32 && !defined __CYGWIN__
|
#if defined _WIN32 && !defined __CYGWIN__
|
||||||
|
|
||||||
#ifndef MAXPATHLEN
|
|
||||||
# define MAXPATHLEN 1024
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HINSTANCE handle;
|
HINSTANCE handle;
|
||||||
char winfile[MAXPATHLEN];
|
char winfile[MAXPATHLEN];
|
||||||
void (*init_fct)();
|
void (*init_fct)();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user