diff --git a/src/node_buffer.h b/src/node_buffer.h index b00badb35f..fe2abb9e5e 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -19,6 +19,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +#include "node.h" #include "smalloc.h" #include "v8.h" @@ -31,29 +32,29 @@ namespace Buffer { static const unsigned int kMaxLength = smalloc::kMaxLength; -bool HasInstance(v8::Handle val); -bool HasInstance(v8::Handle val); -char* Data(v8::Handle val); -char* Data(v8::Handle val); -size_t Length(v8::Handle val); -size_t Length(v8::Handle val); +NODE_EXTERN bool HasInstance(v8::Handle val); +NODE_EXTERN bool HasInstance(v8::Handle val); +NODE_EXTERN char* Data(v8::Handle val); +NODE_EXTERN char* Data(v8::Handle val); +NODE_EXTERN size_t Length(v8::Handle val); +NODE_EXTERN size_t Length(v8::Handle val); // public constructor -v8::Local New(size_t length); +NODE_EXTERN v8::Local New(size_t length); // public constructor from string -v8::Local New(v8::Handle string); +NODE_EXTERN v8::Local New(v8::Handle string); // public constructor - data is copied // TODO(trevnorris): should be something like Copy() -v8::Local New(const char* data, size_t len); +NODE_EXTERN v8::Local New(const char* data, size_t len); // public constructor - data is used, callback is passed data on object gc -v8::Local New(char* data, - size_t length, - smalloc::FreeCallback callback, - void* hint); +NODE_EXTERN v8::Local New(char* data, + size_t length, + smalloc::FreeCallback callback, + void* hint); // public constructor - data is used. // TODO(trevnorris): should be New() for consistency -v8::Local Use(char* data, uint32_t len); +NODE_EXTERN v8::Local Use(char* data, uint32_t len); } // namespace Buffer diff --git a/src/smalloc.h b/src/smalloc.h index bfd41cabec..be4515b487 100644 --- a/src/smalloc.h +++ b/src/smalloc.h @@ -22,6 +22,7 @@ #ifndef NODE_SMALLOC_H_ #define NODE_SMALLOC_H_ +#include "node.h" #include "v8.h" namespace node { @@ -38,29 +39,29 @@ namespace smalloc { // mirrors deps/v8/src/objects.h static const unsigned int kMaxLength = 0x3fffffff; -typedef void (*FreeCallback)(char* data, void* hint); +NODE_EXTERN typedef void (*FreeCallback)(char* data, void* hint); /** * Allocate external memory and set to passed object. If data is passed then * will use that instead of allocating new. */ -void Alloc(v8::Handle obj, size_t length); -void Alloc(v8::Handle obj, char* data, size_t length); -void Alloc(v8::Handle obj, - size_t length, - FreeCallback fn, - void* hint); -void Alloc(v8::Handle obj, - char* data, - size_t length, - FreeCallback fn, - void* hint); +NODE_EXTERN void Alloc(v8::Handle obj, size_t length); +NODE_EXTERN void Alloc(v8::Handle obj, char* data, size_t length); +NODE_EXTERN void Alloc(v8::Handle obj, + size_t length, + FreeCallback fn, + void* hint); +NODE_EXTERN void Alloc(v8::Handle obj, + char* data, + size_t length, + FreeCallback fn, + void* hint); /** * Free memory associated with an externally allocated object. If no external * memory is allocated to the object then nothing will happen. */ -void AllocDispose(v8::Handle obj); +NODE_EXTERN void AllocDispose(v8::Handle obj); } // namespace smalloc