Re: [AD] Using procfs on UNIX for get_executable_name

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I'll be making a patch to remove END_OF_MAIN() and with it __crt0_argv on 
> UNIX systems later on, if we still want that.

Attached. Moderately tested.

Evert
Index: makefile.lst
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.lst,v
retrieving revision 1.102
diff -u -r1.102 makefile.lst
--- makefile.lst	18 Aug 2004 12:04:58 -0000	1.102
+++ makefile.lst	21 Aug 2004 09:34:56 -0000
@@ -274,7 +274,6 @@
 	src/unix/arts.c \
 	src/unix/sgial.c \
 	src/unix/jack.c \
-	src/unix/udjgpp.c \
 	src/unix/udrvlist.c \
 	src/unix/udummy.c \
 	src/unix/uesd.c \
@@ -282,7 +281,6 @@
 	src/unix/ugfxdrv.c \
 	src/unix/ujoydrv.c \
 	src/unix/ukeybd.c \
-	src/unix/umain.c \
 	src/unix/umodules.c \
 	src/unix/umouse.c \
 	src/unix/uoss.c \
Index: include/allegro/platform/alunix.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/platform/alunix.h,v
retrieving revision 1.12
diff -u -r1.12 alunix.h
--- include/allegro/platform/alunix.h	9 Apr 2004 10:37:45 -0000	1.12
+++ include/allegro/platform/alunix.h	21 Aug 2004 09:34:56 -0000
@@ -21,22 +21,6 @@
 #endif
 
 
-/* magic to capture name of executable file */
-extern int    __crt0_argc;
-extern char **__crt0_argv;
-
-#ifndef ALLEGRO_NO_MAGIC_MAIN
-   #define ALLEGRO_MAGIC_MAIN
-   #define main _mangled_main
-   #undef END_OF_MAIN
-   #define END_OF_MAIN() void *_mangled_main_address = (void*) _mangled_main;
-#else
-   #undef END_OF_MAIN
-   #define END_OF_MAIN() void *_mangled_main_address;
-#endif
-
-
-
 /**************************************/
 /************ General Unix ************/
 /**************************************/
Index: src/unix/usystem.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/unix/usystem.c,v
retrieving revision 1.31
diff -u -r1.31 usystem.c
--- src/unix/usystem.c	17 Aug 2004 19:39:43 -0000	1.31
+++ src/unix/usystem.c	21 Aug 2004 09:34:56 -0000
@@ -410,10 +410,6 @@
       return;
    }
 
-   /* Try the captured argv[0] */   
-   if (_find_executable_file(__crt0_argv[0], output, size))
-      return;
-
    /* Give up; return empty string */
    do_uconvert ("", U_ASCII, output, U_CURRENT, size);
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/