mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Various changes wrt shared-library python:
- Moved fileargument to config.c - Added PyMac_AddLibResources() call in case of shlib python - Build argc/argv differently in case of applet template
This commit is contained in:
parent
8cd2b720f6
commit
f950f8d414
1 changed files with 39 additions and 7 deletions
|
|
@ -29,6 +29,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "rename2.h"
|
#include "rename2.h"
|
||||||
|
#include "mymalloc.h"
|
||||||
|
|
||||||
#ifdef THINK_C
|
#ifdef THINK_C
|
||||||
#define CONSOLE_IO
|
#define CONSOLE_IO
|
||||||
|
|
@ -45,12 +46,20 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <SIOUX.h>
|
#include <SIOUX.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *fileargument;
|
extern char *fileargument;
|
||||||
|
|
||||||
main(argc, argv)
|
main(argc, argv)
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
|
#ifdef USE_MAC_SHARED_LIBRARY
|
||||||
|
PyMac_AddLibResources();
|
||||||
|
#endif
|
||||||
|
#ifdef __MWERKS__
|
||||||
|
SIOUXSettings.asktosaveonclose = 0;
|
||||||
|
SIOUXSettings.showstatusline = 0;
|
||||||
|
SIOUXSettings.tabspaces = 4;
|
||||||
|
#endif
|
||||||
#ifdef USE_STDWIN
|
#ifdef USE_STDWIN
|
||||||
#ifdef THINK_C
|
#ifdef THINK_C
|
||||||
/* This is done to initialize the Think console I/O library before stdwin.
|
/* This is done to initialize the Think console I/O library before stdwin.
|
||||||
|
|
@ -68,13 +77,36 @@ main(argc, argv)
|
||||||
a better way!) */
|
a better way!) */
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MWERKS__
|
#ifdef BUILD_APPLET_TEMPLATE
|
||||||
SIOUXSettings.asktosaveonclose = 0;
|
/* Make argv[0] and [1] be application name. The "argument" will later
|
||||||
SIOUXSettings.showstatusline = 0;
|
** be recognized as APPL type and interpreted as being a .pyc file.
|
||||||
SIOUXSettings.tabspaces = 4;
|
** XXXX Should be changed. Argv[0] should be the shared lib location or
|
||||||
#endif
|
** something, so we can find our Lib directory, etc.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
char *progname;
|
||||||
|
extern char *getappname();
|
||||||
|
|
||||||
|
progname = getappname();
|
||||||
|
if ( (argv = (char **)malloc(3*sizeof(char *))) == NULL ) {
|
||||||
|
fprintf(stderr, "No memory\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
argv[0] = malloc(strlen(progname)+1);
|
||||||
|
argv[1] = malloc(strlen(progname)+1);
|
||||||
|
argv[2] = NULL;
|
||||||
|
if ( argv[0] == NULL || argv[1] == NULL ) {
|
||||||
|
fprintf(stderr, "No memory\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
strcpy(argv[0], progname);
|
||||||
|
strcpy(argv[1], progname);
|
||||||
|
argc = 2;
|
||||||
|
}
|
||||||
|
#else
|
||||||
/* Use STDWIN's wargs() to set argc/argv to list of files to open */
|
/* Use STDWIN's wargs() to set argc/argv to list of files to open */
|
||||||
wargs(&argc, &argv);
|
wargs(&argc, &argv);
|
||||||
|
#endif
|
||||||
/* Put About Python... in Apple menu */
|
/* Put About Python... in Apple menu */
|
||||||
{
|
{
|
||||||
extern char *about_message;
|
extern char *about_message;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue