From: VMware, Inc <> Date: Thu, 27 Oct 2011 18:48:17 +0000 (-0700) Subject: open-vm-tools: fix non-Linux build. X-Git-Tag: 2011.10.26-514583~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9be74a297f228ac9d3f9e56ceb9554fbab22fa46;p=thirdparty%2Fopen-vm-tools.git open-vm-tools: fix non-Linux build. Need a new stub file. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/stubs/Makefile.am b/open-vm-tools/lib/stubs/Makefile.am index 04a9a4c09..a6cbf7e88 100644 --- a/open-vm-tools/lib/stubs/Makefile.am +++ b/open-vm-tools/lib/stubs/Makefile.am @@ -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 index 000000000..2679f3bad --- /dev/null +++ b/open-vm-tools/lib/stubs/stub-msgfmt-fbsd.c @@ -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); +} +