diff --git a/include/ipfs/path/path.h b/include/ipfs/path/path.h index a305938..f2a97c1 100644 --- a/include/ipfs/path/path.h +++ b/include/ipfs/path/path.h @@ -1,16 +1,20 @@ #ifndef IPFS_PATH_H #define IPFS_PATH_H - char *ErrPath[] = { - NULL, - // ErrBadPath is returned when a given path is incorrectly formatted - "invalid 'ipfs ref' path", - // Paths after a protocol must contain at least one component - "path must contain at least one component", - "TODO: ErrCidDecode", - NULL, - "no link named %s under %s" - }; + #ifdef IPFS_PATH_C + char *ErrPath[] = { + NULL, + // ErrBadPath is returned when a given path is incorrectly formatted + "invalid 'ipfs ref' path", + // Paths after a protocol must contain at least one component + "path must contain at least one component", + "TODO: ErrCidDecode", + NULL, + "no link named %s under %s" + }; + #else + extern char **ErrPath; + #endif // IPFS_PATH_C enum { ErrBadPath = 1, diff --git a/path/path.c b/path/path.c index 057835c..21bfc4a 100644 --- a/path/path.c +++ b/path/path.c @@ -1,6 +1,7 @@ #include #include #include +#define IPFS_PATH_C #include // FromCid safely converts a cid.Cid type to a Path type