]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
open-vm-tools: fix non-Linux build.
authorVMware, Inc <>
Thu, 27 Oct 2011 18:48:17 +0000 (11:48 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 27 Oct 2011 18:48:17 +0000 (11:48 -0700)
Need a new stub file.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/stubs/Makefile.am
open-vm-tools/lib/stubs/stub-msgfmt-fbsd.c [new file with mode: 0644]

index 04a9a4c09c5810114e57b1ce50046fbaf6990abd..a6cbf7e88fd3beaa958bcb7aa16e3f9fa2fed825 100644 (file)
@@ -31,3 +31,8 @@ libStubsCS_la_SOURCES =
 libStubsCS_la_SOURCES += stub-config.c
 libStubsCS_la_SOURCES += stub-user-msg.c
 libStubsCS_la_SOURCES += stub-user-panic.c
+
+if !LINUX
+   libStubsCS_la_SOURCES += stub-msgfmt-fbsd.c
+endif
+
diff --git a/open-vm-tools/lib/stubs/stub-msgfmt-fbsd.c b/open-vm-tools/lib/stubs/stub-msgfmt-fbsd.c
new file mode 100644 (file)
index 0000000..2679f3b
--- /dev/null
@@ -0,0 +1,55 @@
+/*********************************************************
+ * Copyright (C) 2008 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation version 2.1 and no later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
+ *
+ *********************************************************/
+
+/*
+ * stub-msgfmt-fbsd.c --
+ *
+ *    FreeBSD-specific stubs for lib/misc/msgfmt.c. This stubs out two
+ *    specific funtions in that file - MsgFmt_Asprintf and MsgFmt_Snprintf,
+ *    which don't have FreeBSD implementations in our code base.
+ *
+ *    Tools don't really use the Msg_* functions for error reporting and etc,
+ *    so this is easier than getting all that stuff to compile on FreeBSD.
+ *
+ *    The stubs won't assert, but they're sort of dumb: they'll just
+ *    print the format string with no substitutions to the output.
+ */
+
+#include "msgfmt.h"
+#include "str.h"
+
+int
+MsgFmt_Snprintf(char *buf,                // OUT: formatted string
+                size_t size,              // IN: size of buffer
+                const char *format,       // IN: format
+                const MsgFmt_Arg *args,   // IN: message arguments
+                int numArgs)              // IN: number of arguments
+{
+   return Str_Snprintf(buf, size, "%s", format);
+}
+
+
+char *
+MsgFmt_Asprintf(size_t *length,           // OUT: length of returned string
+                const char *format,       // IN: format
+                const MsgFmt_Arg *args,   // IN: message arguments
+                int numArgs)              // IN: number of arguments
+{
+   return Str_Asprintf(length, "%s", format);
+}
+