Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of changes #42

Merged
merged 11 commits into from
Jun 4, 2022
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ jobs:
run: pip install cpplint

- name: Run cpplint
run: cpplint --linelength=120 --filter=-whitespace/indent include/dylib.hpp
run: cpplint --linelength=140 --filter=-whitespace/indent,-whitespace/parens include/dylib.hpp
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2022 Martin Olivier
Copyright (c) 2022 Eyal Rozenberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 23 additions & 13 deletions example/lib.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#include <iostream>
#include "dylib.hpp"

DYLIB_API double pi_value = 3.14159;
DYLIB_API void *ptr = (void *)1;

DYLIB_API double adder(double a, double b) {
return a + b;
}

DYLIB_API void print_hello() {
std::cout << "Hello" << std::endl;
}
#include <iostream>
#include "dylib.hpp"

#if defined(_WIN32) || defined(_WIN64)
#define LIB_API __declspec(dllexport)
#else
#define LIB_API
#endif

extern "C" {

LIB_API double pi_value = 3.14159;
LIB_API void *ptr = (void *)1;

LIB_API double adder(double a, double b) {
return a + b;
}

LIB_API void print_hello() {
std::cout << "Hello" << std::endl;
}

} // extern "C"
Loading