Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
70 user(s) are online (52 user(s) are browsing Forums)

Members: 0
Guests: 70

more...

Support us!

Headlines

Report message:*
 

Re: vswprintf implementation (need floating point support)

Subject: Re: vswprintf implementation (need floating point support)
by salass00 on 2019/10/13 20:35:04

@kas1e

Quote:

Thanks a bunch! Checked library : with gcc it works, with g++ not, saing about undefs. I assume there need some C++ guards as usually inside of libwprinf.h ? Maybe forgotten extern "C" or something ?


Change the libwprintf.h header to:

#ifndef LIBWPRINTF_H
#define LIBWPRINTF_H

#include <stdio.h>
#include <stdarg.h>
#include <wchar.h>

#ifdef __cplusplus
extern "C" {
#endif

int swprintf(wchar_t *buffersize_t maxlen, const wchar_t *fmt, ...);
int vswprintf(wchar_t *buffersize_t maxlen, const wchar_t *fmtva_list ap);

int fwprintf(FILE *fp, const wchar_t *fmt, ...);
int vfwprintf(FILE *fp, const wchar_t *fmtva_list ap);

#ifdef __cplusplus
}
#endif

#endif


and it will work with C++ too.

As I code mainly in plain C I tend to forget such things.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project