diff --git a/include/alloca.h b/include/alloca.h index ac78e46038d45896e8942009884693a667539723..f61b817a54e192a1e32440be48522958c05f1454 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -1,9 +1,17 @@ #ifndef _ALLOCA_H #define _ALLOCA_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_size_t #include void *alloca(size_t); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 9342713065bb46754daf0d1dbc67d8cfaeb9a6b4..b604f60b18006896e30a2407591655cf5bea8395 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -1,6 +1,10 @@ #ifndef _ARPA_INET_H #define _ARPA_INET_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -30,4 +34,8 @@ int inet_aton (const char *, struct in_addr *); /* nonstandard but widely used * #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ctype.h b/include/ctype.h index a605d089247ba7dafe0d4cc538f3875345bf7cf1..a85e907eb0fb36bdff696afd512522afdc0d6dce 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,6 +1,10 @@ #ifndef _CTYPE_H #define _CTYPE_H +#ifdef __cplusplus +extern "C" { +#endif + int isalnum(int); int isalpha(int); int isblank(int); @@ -53,4 +57,8 @@ int toascii(int); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ftw.h b/include/ftw.h index 8d31c6d952e97140d11634ab897f20e399c49d78..9bb38c777a46a9ee1edb79d7929689d8c30236f4 100644 --- a/include/ftw.h +++ b/include/ftw.h @@ -1,6 +1,10 @@ #ifndef _FTW_H #define _FTW_H +#ifdef __cplusplus +extern "C" { +#endif + /* Normally we do not nest header includes. However useless bloat * like ftw may be treated as a special case. Otherwise we would * have to deal with duplicating all the stat.h mess. */ @@ -28,4 +32,8 @@ struct FTW int ftw(const char *, int (*)(const char *, const struct stat *, int), int); int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/math.h b/include/math.h index 677248287ae99470346db96e5d64926ed12b7645..9c5f06e7b6e7830c0c21dc5d5a9e2a6d7e0c72b7 100644 --- a/include/math.h +++ b/include/math.h @@ -1,6 +1,10 @@ #ifndef _MATH_H #define _MATH_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED___uint16_t #define __NEED___uint32_t #define __NEED___uint64_t @@ -317,4 +321,8 @@ extern int signgam; double scalb(double, double); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/net/ethernet.h b/include/net/ethernet.h index a536502d945924b4425ce0cd63ed540a2f86d934..f3c11e7da3e52cec3116bf4d2a7880ab09d676e8 100644 --- a/include/net/ethernet.h +++ b/include/net/ethernet.h @@ -1,6 +1,10 @@ #ifndef __NET_ETHERNET_H #define __NET_ETHERNET_H 1 +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -44,4 +48,8 @@ struct ether_header { #define ETHERMTU ETH_DATA_LEN #define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/net/if.h b/include/net/if.h index 2ae5f89ef0d3d82ff1716e68bef032fa94b32b52..00c763a482d84f6e66feefa1908038dcc16857ab 100644 --- a/include/net/if.h +++ b/include/net/if.h @@ -1,6 +1,10 @@ #ifndef _NET_IF_H #define _NET_IF_H +#ifdef __cplusplus +extern "C" { +#endif + #define IF_NAMESIZE 16 struct if_nameindex @@ -117,6 +121,8 @@ struct ifconf { #endif - +#ifdef __cplusplus +} +#endif #endif diff --git a/include/net/route.h b/include/net/route.h index 3aaab978ed72fa0ff078b600d94d5c00ab2a6736..96ff48e014ce6ee08270b0497ed2d662c09e01e7 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -1,6 +1,10 @@ #ifndef _NET_ROUTE_H #define _NET_ROUTE_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -113,4 +117,8 @@ struct in6_rtmsg { #define RTMSG_AR_FAILED 0x51 +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/netinet/in.h b/include/netinet/in.h index b7b8c82370b84fe8578b5547863a94da781b90f7..cae16c7dfb56d8c12a070a07a3b3193bdd446368 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -1,6 +1,10 @@ #ifndef _NETINET_IN_H #define _NETINET_IN_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_in_addr_t #define __NEED_in_port_t #define __NEED_sa_family_t @@ -300,4 +304,8 @@ struct ip6_mtuinfo #define IPV6_RTHDR_TYPE_0 0 +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/mount.h b/include/sys/mount.h index 9420c5647212460dfa6dad4b0824065d34f13919..3f652e9710379e8eec7e1061ccd6321ad435e51f 100644 --- a/include/sys/mount.h +++ b/include/sys/mount.h @@ -1,6 +1,10 @@ #ifndef _SYS_MOUNT_H #define _SYS_MOUNT_H +#ifdef __cplusplus +extern "C" { +#endif + #include #define BLKROSET _IO(0x12, 93) @@ -43,4 +47,8 @@ int mount(const char *, const char *, const char *, unsigned long, const void *) int umount(const char *); int umount2(const char *, int); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/msg.h b/include/sys/msg.h index 06f255334b18eec8198b55e1991d962a8a12095f..460275c52bb3c41210de25c9b1acaf16069929c9 100644 --- a/include/sys/msg.h +++ b/include/sys/msg.h @@ -1,6 +1,10 @@ #ifndef _SYS_MSG_H #define _SYS_MSG_H +#ifdef __cplusplus +extern "C" { +#endif + #include #define __NEED_pid_t @@ -33,4 +37,8 @@ int msgget (key_t, int); ssize_t msgrcv (int, void *, size_t, long, int); int msgsnd (int, const void *, size_t, int); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/resource.h b/include/sys/resource.h index 7837adb3a048a002a7f3856009d5bdd1d5edae00..b91890286c2a3b6f016bb6108d6cd8cfbdbb2c55 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -1,6 +1,10 @@ #ifndef _SYS_RESOURCE_H #define _SYS_RESOURCE_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_id_t #define __NEED_time_t #define __NEED_struct_timeval @@ -76,4 +80,8 @@ int setpriority (int, id_t, int); #define RLIM_NLIMITS RLIMIT_NLIMITS +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/shm.h b/include/sys/shm.h index fa927101886a1303db6a66ccf71203ae13cc98af..34117cc850fc15fc6f630c1976bfb8db7483d653 100644 --- a/include/sys/shm.h +++ b/include/sys/shm.h @@ -1,6 +1,10 @@ #ifndef _SYS_SHM_H #define _SYS_SHM_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_time_t #define __NEED_size_t #define __NEED_pid_t @@ -43,4 +47,8 @@ int shmctl(int, int, struct shmid_ds *); int shmdt(const void *); int shmget(key_t, size_t, int); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/statfs.h b/include/sys/statfs.h index 05c9b13049fd440992b94eca851fa12a99977c44..f5239d8f31fa4700d02c9c06cdda4554937b0bfb 100644 --- a/include/sys/statfs.h +++ b/include/sys/statfs.h @@ -1,6 +1,10 @@ #ifndef _SYS_STATFS_H #define _SYS_STATFS_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef struct { @@ -12,4 +16,8 @@ typedef struct { int statfs (const char *, struct statfs *); int fstatfs (int, struct statfs *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h index fd22faba8afa0d554b01e7e545805f89f71995fd..b9f72b7ee1fa39dded79e8fabcaedacc94775b0a 100644 --- a/include/sys/statvfs.h +++ b/include/sys/statvfs.h @@ -1,6 +1,9 @@ #ifndef _SYS_STATVFS_H #define _SYS_STATVFS_H +#ifdef __cplusplus +extern "C" { +#endif #define __NEED_fsblkcnt_t #define __NEED_fsfilcnt_t @@ -38,5 +41,8 @@ int fstatvfs (int, struct statvfs *); #define ST_NOATIME 1024 #define ST_NODIRATIME 2048 +#ifdef __cplusplus +} +#endif #endif diff --git a/include/sys/swap.h b/include/sys/swap.h index c5824f1dc07d5e07da987d528e337c3c15009dcc..1bd6159e5f77aab1887d036f78915af0f7a58ff1 100644 --- a/include/sys/swap.h +++ b/include/sys/swap.h @@ -1,6 +1,11 @@ #ifndef _SYS_SWAP_H #define _SYS_SWAP_H +#ifdef __cplusplus +extern "C" { +#endif + + #define SWAP_FLAG_PREFER 0x8000 #define SWAP_FLAG_PRIO_MASK 0x7fff #define SWAP_FLAG_PRIO_SHIFT 0 @@ -8,4 +13,8 @@ int swapon (const char *, int); int swapoff (const char *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/sysctl.h b/include/sys/sysctl.h index af5ca8baa146ab4978be462fc2149f77c97cef40..c358b7949ebb1e18c406c66a78f25c482ef56a62 100644 --- a/include/sys/sysctl.h +++ b/include/sys/sysctl.h @@ -1,9 +1,17 @@ #ifndef _SYS_SYSCTL_H #define _SYS_SYSCTL_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_size_t #include int sysctl (int *, int, void *, size_t *, void *, size_t); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h index ca52088aef477bbc237e581aed74ca2e78defaed..3bf6cb0f7398a1b90158014385d498049486f81a 100644 --- a/include/sys/sysinfo.h +++ b/include/sys/sysinfo.h @@ -1,6 +1,10 @@ #ifndef _SYS_SYSINFO_H #define _SYS_SYSINFO_H +#ifdef __cplusplus +extern "C" { +#endif + /* ?? */ #define SI_LOAD_SHIFT 16 @@ -26,4 +30,8 @@ int get_nprocs (void); long long get_phys_pages (void); long long get_avphys_pages (void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/times.h b/include/sys/times.h index aca743d3e4e73276b0530f43b384ce71f26e3edc..cc55e573fd4b87d1a949423e5c71cc4e2b12b552 100644 --- a/include/sys/times.h +++ b/include/sys/times.h @@ -1,6 +1,10 @@ #ifndef _SYS_TIMES_H #define _SYS_TIMES_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_clock_t #include @@ -14,4 +18,9 @@ struct tms clock_t times (struct tms *); +#ifdef __cplusplus +} #endif + +#endif + diff --git a/include/sys/uio.h b/include/sys/uio.h index 11b6bd27202baea230a6507914bd4e9beecb158e..f77db33aef73c4f86a40307ad946d47a446f48b3 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -1,6 +1,10 @@ #ifndef _SYS_UIO_H #define _SYS_UIO_H +#ifdef __cplusplus +extern "C" { +#endif + #define __NEED_size_t #define __NEED_ssize_t #define __NEED_struct_iovec @@ -10,4 +14,8 @@ ssize_t readv (int, const struct iovec *, int); ssize_t writev (int, const struct iovec *, int); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/sys/utsname.h b/include/sys/utsname.h index 383e8251428625c34b0a98b87dcad14d981ec3a1..4c36960ff89a70a10189ed54eed7ce067aa83a2d 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -1,6 +1,10 @@ #ifndef _SYS_UTSNAME_H #define _SYS_UTSNAME_H +#ifdef __cplusplus +extern "C" { +#endif + struct utsname { char sysname[65]; @@ -17,5 +21,8 @@ struct utsname int uname (struct utsname *); +#ifdef __cplusplus +} +#endif #endif