How to determine whether a compiler supports wide character or not

A

Ashabul Yeameen

I am writing a program which at some point need to call fputwc()
function. But since I want to make this code portable I've decided to
write my own fputwc() funcion where the compiler doesn't supply this
funcion. But how to determine whether the compiler supports wide
character or not (depending on which my funcion will compile). Is
there any preprocessor directive?

thanks in advance

-Yeameen
 
M

Mike Wahler

Ashabul Yeameen said:
I am writing a program which at some point need to call fputwc()
function. But since I want to make this code portable I've decided to
write my own fputwc() funcion where the compiler doesn't supply this
funcion. But how to determine whether the compiler supports wide
character or not (depending on which my funcion will compile). Is
there any preprocessor directive?

#include <stddef.h>

int main()
{
wchar_t wc;
return 0;
}

If it compiles, your implementation supports wide characters.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top