C #ifdef question

V13 v13 at priest.com
Mon May 19 12:27:01 EEST 2003


On Monday 19 May 2003 11:02, Marios Trivizas wrote:
> Γεια σας,
>
> Θέλω στα header αρχεία μου, αν το λειτουργικό είναι Linux να κάνω
> include κάποια header του συστήματος ενώ αν δεν είναι να κάνω κάποια
> άλλα. Το παρακάτω είναι σωστό?
>
> #ifdef LINUX
> 	#include <sys/select.h>
> #else
> 	#include <sys/types.h>
> 	#include <sys/time.h>
> 	#include <unistd.h>
> #endif

Oxi.. to # baze to stin proti stili..p.x.

#ifdef LINUX
#	include <sys/select.h>
#else
#	include ....
#endif

Giati yparxoyn compilers poy xtypane lathos se ayto...

> Μπορώ να κάνω έναν αντίστοιχο έλεγχο στο Makefile μου ώστε να κάνω link
> κάθε φορά τις κατάλληλες βιβλιοθήκες ανάλογα με το λειτουργικό?
> (π.χ. Linux: -lpthread   ,   FreeBSD: -pthread)

Des to autoconf+automake[1]. Stin arxi tha pelagoseis, alla einai ayto poy 
xreiazesai an se endiaferei to portability... Sto google tha breis tutorials 
(an kai ta info pages poy exoyn einai to A kai to O(mega))...

[1] info autoconf ; info automake

> Μάριος
<<V13>>



More information about the Linux-greek-users mailing list