From: Simon Josefsson Date: Thu, 10 Nov 2011 10:22:34 +0000 (+0100) Subject: Use extern "C" keywords. X-Git-Tag: v1.6.2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=295534c9dc17f8da6c9092003f28a5172f4f9c94;p=yubikey-personalization.old Use extern "C" keywords. --- diff --git a/NEWS b/NEWS index 73217f6..2e9c875 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,10 @@ Yubikey-personalize NEWS -- History of user-visible changes. -*- outline -*- +* Version 1.6.2 (unreleased) + +** Header files are now usable from C++. +Reported by Giampaolo Bellini. + * Version 1.6.1 (released 2011-08-15) ** Fix test_args_to_config crash on some platform. diff --git a/ykcore/ykcore.h b/ykcore/ykcore.h index 68f7b07..d44722e 100644 --- a/ykcore/ykcore.h +++ b/ykcore/ykcore.h @@ -1,6 +1,6 @@ /* -*- mode:C; c-file-style: "bsd" -*- */ /* - * Copyright (c) 2008, 2009, Yubico AB + * Copyright (c) 2008-2011, Yubico AB * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +35,10 @@ #include #include +# ifdef __cplusplus +extern "C" { +# endif + /************************************************************************* ** ** N O T E : For all functions that return a value, 0 and NULL indicates @@ -142,4 +146,8 @@ const char *yk_usb_strerror(); #define YK_CRC_OK_RESIDUAL 0xf0b8 +# ifdef __cplusplus +} +# endif + #endif /* __YKCORE_H_INCLUDED__ */ diff --git a/ykcore/ykstatus.h b/ykcore/ykstatus.h index 44c105d..df3c25b 100644 --- a/ykcore/ykstatus.h +++ b/ykcore/ykstatus.h @@ -1,7 +1,7 @@ /* -*- mode:C; c-file-style: "bsd" -*- */ /* * Written by Richard Levitte - * Copyright (c) 2008, Yubico AB + * Copyright (c) 2008-2011, Yubico AB * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,6 +34,10 @@ #include +# ifdef __cplusplus +extern "C" { +# endif + /* Allocate and free status structures */ extern YK_STATUS *ykds_alloc(void); extern void ykds_free(YK_STATUS *st); @@ -49,4 +53,8 @@ extern int ykds_version_build(const YK_STATUS *st); extern int ykds_pgm_seq(const YK_STATUS *st); extern int ykds_touch_level(const YK_STATUS *st); +# ifdef __cplusplus +} +# endif + #endif /* __YKSTATUS_H_INCLUDED__ */ diff --git a/ykpers.h b/ykpers.h index f155cfe..f5c59e0 100644 --- a/ykpers.h +++ b/ykpers.h @@ -1,6 +1,6 @@ /* -*- mode:C; c-file-style: "bsd" -*- */ /* - * Copyright (c) 2008, 2009, 2010, 2011 Yubico AB + * Copyright (c) 2008-2011 Yubico AB * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +35,10 @@ #include #include +# ifdef __cplusplus +extern "C" { +# endif + typedef struct ykp_config_t YKP_CONFIG; /* This only works with Yubikey 1 unless it's fed with a YK_STATUS using @@ -113,4 +117,8 @@ const char *ykp_strerror(int errnum); #define YKP_EINVCONFNUM 0x05 #define YKP_EINVAL 0x06 +# ifdef __cplusplus +} +# endif + #endif /* __YKPERS_H_INCLUDED__ */