Skip to content

Commit

Permalink
Add extern C to userspace lib header files
Browse files Browse the repository at this point in the history
  • Loading branch information
Alain FLAISCHER committed May 24, 2017
1 parent 6263211 commit baa90fc
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sdk/userspace/include/fpga_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <hal/fpga_common.h>
#include <fpga_pci.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* Initialize the fpga_mgmt library.
* Calls fpga_pci_init.
Expand Down Expand Up @@ -158,3 +162,7 @@ int fpga_mgmt_set_vDIP(int slot_id, uint16_t value);
* @returns 0 on success, non-zero on error
*/
int fpga_mgmt_get_vDIP_status(int slot_id, uint16_t *value);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions sdk/userspace/include/fpga_pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

#include <hal/fpga_common.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* FPGA_PCI_BARS_MAX:
* -compile time tunable via mkall_fpga_mgmt_tools.sh, with the below default.
Expand Down Expand Up @@ -203,3 +207,7 @@ int fpga_pci_rescan_slot_app_pfs(int slot_id);
*/
int fpga_pci_get_address(pci_bar_handle_t handle, uint64_t offset,
uint64_t dword_len, void **ptr);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions sdk/userspace/include/utils/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include <stdbool.h>
#include <sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* Set up epoll.
*
Expand Down Expand Up @@ -200,3 +204,7 @@ int string_to_uint(unsigned int *num, const char *str);
* @returns How many files are open in a given process, -1 on error.
*/
int number_of_open_files(pid_t pid);

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions sdk/userspace/include/utils/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
/** PCI device format string */
#define PCI_DEV_FMT "%04x:%02x:%02x.%d"

#ifdef __cplusplus
extern "C" {
#endif

/**
* Sleep for some milliseconds.
*
Expand All @@ -48,3 +52,7 @@ static inline int msleep(uint64_t ms)

return clock_nanosleep(CLOCK_MONOTONIC, 0, &sleep_time, NULL);
}

#ifdef __cplusplus
}
#endif
8 changes: 8 additions & 0 deletions sdk/userspace/include/utils/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ enum {
LOGGER_FLAGS_SERIALIZE = (1u << 0),
};

#ifdef __cplusplus
extern "C" {
#endif

/** Logger. */
struct logger {
/** Name (for debugging). */
Expand Down Expand Up @@ -174,3 +178,7 @@ static inline __printf(1, 2) void log_dummy(const char *fmt, ...)
extern const struct logger logger_stdout;
extern const struct logger logger_kmsg;
extern const struct logger *logger_default;

#ifdef __cplusplus
}
#endif

0 comments on commit baa90fc

Please sign in to comment.