Created
May 15, 2018 14:55
-
-
Save CristianCantoro/0b3c5eeeeb7f4065dd514fdb21cb82de to your computer and use it in GitHub Desktop.
An header that works for C and C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TSP_H | |
#define TSP_H | |
#ifdef __cplusplus | |
// C++ code | |
using namespace std; | |
namespace helpers { | |
long long get_elapsed_time(void); | |
bool has_reached_timeout(void); | |
void setup(void); | |
} | |
#else | |
// C code | |
#include <stdbool.h> | |
long long get_elapsed_time(void); | |
bool has_reached_timeout(void); | |
void setup(void); | |
#error Only C++ is supported | |
#endif | |
#endif | |
#pragma once |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment