Revision: 77194
          http://sourceforge.net/p/brlcad/code/77194
Author:   starseeker
Date:     2020-09-23 02:40:32 +0000 (Wed, 23 Sep 2020)
Log Message:
-----------
Windows #define of stat doesn't work in this file.

Modified Paths:
--------------
    brlcad/trunk/src/libged/exec_mapping.cpp

Modified: brlcad/trunk/src/libged/exec_mapping.cpp
===================================================================
--- brlcad/trunk/src/libged/exec_mapping.cpp    2020-09-23 02:17:41 UTC (rev 
77193)
+++ brlcad/trunk/src/libged/exec_mapping.cpp    2020-09-23 02:40:32 UTC (rev 
77194)
@@ -31,6 +31,18 @@
 
 #include "ged.h"
 
+/* For this file, we need to undefine stat if defined so the command template
+ * doesn't end up being expanded with the defined version of the string.
+ * Without this we end up with ged__stati64 on Windows, instead of ged_stat.
+ *
+ * If this happens for other commands, the solution will be similar - the
+ * purpose of this function is just to expand templates into definitions to
+ * call ged_cmd_valid and ged_exec, not to actually execute any other
+ * functions; it should be safe to undef them here.
+ */
+#undef stat
+
+
 #define GED_CMD_HELPER1(x, y) x##y
 #define GED_CMD(x) \
        int GED_CMD_HELPER1(ged_,x)(struct ged *gedp, int argc, const char 
*argv[]) \
@@ -47,6 +59,7 @@
            return ret; \
        } \
 
+
 GED_CMD(3ptarb)
 GED_CMD(E)
 GED_CMD(adc)

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to