Revision: 42428
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42428&view=rev
Author:   starseeker
Date:     2011-01-19 01:37:34 +0000 (Wed, 19 Jan 2011)

Log Message:
-----------
Use GetFullPathName on Windows, and remove a couple of the Win32 specific bits 
in mged - this results in mged launching successfully.  Still a lot more to do, 
including figuring out why archer silently crashes.

Modified Paths:
--------------
    brlcad/branches/cmake/src/libbu/brlcad_path.c
    brlcad/branches/cmake/src/mged/mged.c
    brlcad/branches/cmake/src/mged/setup.c

Modified: brlcad/branches/cmake/src/libbu/brlcad_path.c
===================================================================
--- brlcad/branches/cmake/src/libbu/brlcad_path.c       2011-01-19 01:20:43 UTC 
(rev 42427)
+++ brlcad/branches/cmake/src/libbu/brlcad_path.c       2011-01-19 01:37:34 UTC 
(rev 42428)
@@ -22,6 +22,10 @@
 
 #include "common.h"
 
+#ifdef _WIN32
+#include "windows.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -386,7 +390,6 @@
     return 0;
 }
 
-
 const char *
 bu_brlcad_root(const char *rhs, int fail_quietly)
 {
@@ -443,7 +446,11 @@
 #ifdef HAVE_REALPATH
        realpath(lhs, real_path);
 #else
+#  ifdef _WIN32
+       GetFullPathName(lhs, MAXPATHLEN, real_path, NULL);
+#  else
        bu_strlcpy(real_path, lhs, (size_t)MAXPATHLEN);
+#  endif
 #endif
        dirpath = bu_dirname(real_path);
        snprintf(real_path, MAXPATHLEN, "%s", dirpath);
@@ -546,7 +553,11 @@
 #ifdef HAVE_REALPATH
        realpath(full_path, result);
 #else
+#  ifdef _WIN32
+       GetFullPathName(full_path, MAXPATHLEN, result, NULL);
+#  else
        snprintf(result, MAXPATHLEN, "%s", full_path);
+#  endif
 #endif
        if (UNLIKELY(bu_debug & BU_DEBUG_PATHS)) {
            bu_log("Found: BRLCAD_DATA compile-time path [%s]\n", result);

Modified: brlcad/branches/cmake/src/mged/mged.c
===================================================================
--- brlcad/branches/cmake/src/mged/mged.c       2011-01-19 01:20:43 UTC (rev 
42427)
+++ brlcad/branches/cmake/src/mged/mged.c       2011-01-19 01:37:34 UTC (rev 
42428)
@@ -1478,18 +1478,8 @@
        } else {
            struct bu_vls vls;
            int status;
-#if defined(_WIN32) && !defined(__CYGWIN__)
-           const char *tkhtml_path = bu_brlcad_root("bin/Tkhtml3.0", 1);
-
            bu_vls_init(&vls);
-           bu_vls_printf(&vls, "lappend auto_path {%s}", tkhtml_path);
-           (void)Tcl_Eval(INTERP, bu_vls_addr(&vls));
-           bu_vls_trunc(&vls, 0);
-#else
-           bu_vls_init(&vls);
-#endif
 
-
 #ifdef HAVE_SETPGID
            /* make this a process group leader */
            setpgid(0, 0);

Modified: brlcad/branches/cmake/src/mged/setup.c
===================================================================
--- brlcad/branches/cmake/src/mged/setup.c      2011-01-19 01:20:43 UTC (rev 
42427)
+++ brlcad/branches/cmake/src/mged/setup.c      2011-01-19 01:37:34 UTC (rev 
42428)
@@ -421,25 +421,6 @@
     pathname = bu_brlcad_data("tclscripts", 1);
     snprintf(buffer, sizeof(buffer), "%s", pathname);
 
-#ifdef _WIN32
-    if (pathname) {
-       /* XXXXXXXXXXXXXXX UGLY XXXXXXXXXXXXXXXXXX*/
-       int i;
-        struct bu_vls vls;
-
-       bu_strlcat(buffer, "/", MAXPATHLEN);
-
-       for (i=0;i<strlen(buffer);i++) {
-           if (buffer[i]=='\\')
-               buffer[i]='/'; }
-
-       bu_vls_init(&vls);
-       bu_vls_printf(&vls, "source %s/mged/tree.tcl", buffer);
-       (void)Tcl_Eval(INTERP, bu_vls_addr(&vls));
-       bu_vls_free(&vls);
-    }
-#endif
-
     /* link some tcl variables to these corresponding globals */
     Tcl_LinkVar(INTERP, "glob_compat_mode", (char *)&glob_compat_mode, 
TCL_LINK_BOOLEAN);
     Tcl_LinkVar(INTERP, "output_as_return", (char *)&output_as_return, 
TCL_LINK_BOOLEAN);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to