/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
*     Copyright 2014 Couchbase, Inc.
*
*   Licensed under the Apache License, Version 2.0 (the "License");
*   you may not use this file except in compliance with the License.
*   You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*   Unless required by applicable law or agreed to in writing, software
*   distributed under the License is distributed on an "AS IS" BASIS,
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*   See the License for the specific language governing permissions and
*   limitations under the License.
*/
#pragma once

#include <stdarg.h>

#include <platform/visibility.h>

#ifdef __cplusplus
extern "C" {
#endif

PLATFORM_PUBLIC_API
int asprintf(char **ret, const char *format, ...);

PLATFORM_PUBLIC_API
int vasprintf(char **ret, const char *format, va_list ap);

#ifdef __cplusplus
}
#endif

/*
* We have a fair amount of use of this file in our code base.
* Let's just make a dummy file to aviod a lot of #ifdefs
*/
#ifndef strcasecmp
#define strcasecmp(a, b) _stricmp(a, b)
#endif

#ifndef snprintf
#define snprintf _snprintf
#endif

/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
*     Copyright 2014 Couchbase, Inc.
*
*   Licensed under the Apache License, Version 2.0 (the "License");
*   you may not use this file except in compliance with the License.
*   You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*   Unless required by applicable law or agreed to in writing, software
*   distributed under the License is distributed on an "AS IS" BASIS,
*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*   See the License for the specific language governing permissions and
*   limitations under the License.
*/
#pragma once

#include <stdarg.h>

#include <platform/visibility.h>

PLATFORM_PUBLIC_API
int asprintf(char **ret, const char *format, ...);

PLATFORM_PUBLIC_API
int vasprintf(char **ret, const char *format, va_list ap);

/*
* We have a fair amount of use of this file in our code base.
* Let's just make a dummy file to aviod a lot of #ifdefs
*/
#ifndef strcasecmp
#define strcasecmp(a, b) _stricmp(a, b)
#endif

#ifndef snprintf
#define snprintf _snprintf
#endif

--- 
+++ 
@@ -20,11 +20,19 @@
 
 #include <platform/visibility.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 PLATFORM_PUBLIC_API
 int asprintf(char **ret, const char *format, ...);
 
 PLATFORM_PUBLIC_API
 int vasprintf(char **ret, const char *format, va_list ap);
+
+#ifdef __cplusplus
+}
+#endif
 
 /*
 * We have a fair amount of use of this file in our code base.
Set C linkage for win32 [v]asprintf

Change-Id: I7f82255467c05936baa702fa1d532156b0caba12
Reviewed-on: http://review.couchbase.org/52114
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
