Witam.
Zastanawiam się czy da się zrobić coś w takim stylu:
- vector.h (alias vector)
#define VECTOR(name) VECTOR_ ## name ## _H
#ifndef VECTOR(TYPE)
#define VECTOR(TYPE)
#error
#endif
- test.c
#include <stdio.h>
#define TYPE int
#include <vector>
int main(int argc, char **argv)
{
return 0;
}
Taki dostaje komunikat, gdy próbuję to wszystko skompilować:
In file included from stud.c:4:0:
./vector:2:15: warning: extra tokens at end of #ifndef directive [enabled by default]
#ifndef VECTOR(TYPE)
Dziękuje z góry za wszystkie odpowiedzi,
Pozdrawiam