diff --git a/jian/jian.cpp b/jian/jian.cpp new file mode 100644 index 0000000..0910a58 --- /dev/null +++ b/jian/jian.cpp @@ -0,0 +1,21 @@ +#include "jian.h" +#include +bool Sub(int a, int b, int *d) +{ + if (a>0 &&b<0 && a > INT_MAX + b || a<0 && b>0 && a < INT_MIN + b) + { + + return false; + } + else + { + *d = a - b; + return true; + + } + +} +int sub(int a, int b) +{ + return a - b; +} \ No newline at end of file diff --git a/jian/jian.h b/jian/jian.h new file mode 100644 index 0000000..1bb7f66 --- /dev/null +++ b/jian/jian.h @@ -0,0 +1,11 @@ +#ifndef SUB_H +#define SUB_H +#ifdef _DLLAPI +#define DLLAPI _declspec(dllexport) +#else +#define DLLAPI _declspec(dllimport) +#endif +int DLLAPI sub(int a, int b); +bool DLLAPI Sub(int a, int b, int *d); + +#endif \ No newline at end of file diff --git a/jian/jian.vcxproj b/jian/jian.vcxproj new file mode 100644 index 0000000..9b13e32 --- /dev/null +++ b/jian/jian.vcxproj @@ -0,0 +1,87 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D63C0C9A-957C-480B-91CA-63EEB17CC4D3} + Win32Proj + jian + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;JIAN_EXPORTS;_DLLAPI;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;JIAN_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/jian/jian.vcxproj.filters b/jian/jian.vcxproj.filters new file mode 100644 index 0000000..1bca5d4 --- /dev/null +++ b/jian/jian.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 头文件 + + + + + 源文件 + + + \ No newline at end of file