Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d047a3de
Commit
d047a3de
authored
Sep 12, 1994
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mods for HP-UX dynamic loading.
parent
b8114c05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
Python/import.c
Python/import.c
+42
-1
No files found.
Python/import.c
View file @
d047a3de
...
@@ -62,6 +62,7 @@ extern long getmtime(); /* In getmtime.c */
...
@@ -62,6 +62,7 @@ extern long getmtime(); /* In getmtime.c */
WITH_MAC_DL -- Mac dynamic linking (highly experimental)
WITH_MAC_DL -- Mac dynamic linking (highly experimental)
SHORT_EXT -- short extension for dynamic module, e.g. ".so"
SHORT_EXT -- short extension for dynamic module, e.g. ".so"
LONG_EXT -- long extension, e.g. "module.so"
LONG_EXT -- long extension, e.g. "module.so"
hpux -- HP-UX Dynamic Linking - defined by the compiler
(The other WITH_* symbols are used only once, to set the
(The other WITH_* symbols are used only once, to set the
appropriate symbols.)
appropriate symbols.)
...
@@ -69,6 +70,15 @@ extern long getmtime(); /* In getmtime.c */
...
@@ -69,6 +70,15 @@ extern long getmtime(); /* In getmtime.c */
/* Configure dynamic linking */
/* Configure dynamic linking */
#ifdef hpux
#define DYNAMIC_LINK
#include <errno.h>
typedef
void
(
*
dl_funcptr
)();
#define _DL_FUNCPTR_DEFINED 1
#define SHORT_EXT ".sl"
#define LONG_EXT "module.sl"
#endif
#ifdef NT
#ifdef NT
#define DYNAMIC_LINK
#define DYNAMIC_LINK
#include <windows.h>
#include <windows.h>
...
@@ -124,7 +134,7 @@ typedef void (*dl_funcptr)();
...
@@ -124,7 +134,7 @@ typedef void (*dl_funcptr)();
#define LONG_EXT "module.so"
#define LONG_EXT "module.so"
#endif
/* USE_SHLIB */
#endif
/* USE_SHLIB */
#if
def USE_DL
#if
defined(USE_DL) || defined(hpux)
#include "dl.h"
#include "dl.h"
#endif
#endif
...
@@ -143,8 +153,12 @@ typedef void (*dl_funcptr)();
...
@@ -143,8 +153,12 @@ typedef void (*dl_funcptr)();
extern
char
*
getprogramname
();
extern
char
*
getprogramname
();
#ifndef FUNCNAME_PATTERN
#ifndef FUNCNAME_PATTERN
#if defined(__hp9000s300)
#define FUNCNAME_PATTERN "_init%s"
#else
#define FUNCNAME_PATTERN "init%s"
#define FUNCNAME_PATTERN "init%s"
#endif
#endif
#endif
#if !defined(SHORT_EXT) && !defined(LONG_EXT)
#if !defined(SHORT_EXT) && !defined(LONG_EXT)
#define SHORT_EXT ".o"
#define SHORT_EXT ".o"
...
@@ -316,7 +330,34 @@ load_dynamic_module(name, namebuf, m, m_ret)
...
@@ -316,7 +330,34 @@ load_dynamic_module(name, namebuf, m, m_ret)
return
NULL
;
return
NULL
;
}
}
#endif
/* USE_RLD */
#endif
/* USE_RLD */
#ifdef hpux
{
shl_t
lib
;
int
flags
;
flags
=
BIND_DEFERRED
;
if
(
verbose
)
{
flags
=
BIND_IMMEDIATE
|
BIND_NONFATAL
|
BIND_VERBOSE
;
printf
(
"shl_load %s
\n
"
,
namebuf
);
}
lib
=
shl_load
(
namebuf
,
flags
,
0
);
if
(
lib
==
NULL
)
{
char
buf
[
256
];
if
(
verbose
)
perror
(
namebuf
);
sprintf
(
buf
,
"Failed to load %s"
,
namebuf
);
err_setstr
(
ImportError
,
buf
);
return
NULL
;
}
if
(
verbose
)
printf
(
"shl_findsym %s
\n
"
,
funcname
);
shl_findsym
(
&
lib
,
funcname
,
TYPE_UNDEFINED
,
(
void
*
)
&
p
);
if
(
p
==
NULL
&&
verbose
)
perror
(
funcname
);
}
#endif hpux
if
(
p
==
NULL
)
{
if
(
p
==
NULL
)
{
err_setstr
(
ImportError
,
err_setstr
(
ImportError
,
"dynamic module does not define init function"
);
"dynamic module does not define init function"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment