GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: proper API export for Windows · tcper/node@7373c4d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_buffer.h
    • smalloc.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_buffer.h‎

Copy file name to clipboardExpand all lines: src/node_buffer.h
+15-14Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

22+
#include "node.h"
2223
#include "smalloc.h"
2324
#include "v8.h"
2425

@@ -31,29 +32,29 @@ namespace Buffer {
3132

3233
static const unsigned int kMaxLength = smalloc::kMaxLength;
3334

34-
bool HasInstance(v8::Handle<v8::Value> val);
35-
bool HasInstance(v8::Handle<v8::Object> val);
36-
char* Data(v8::Handle<v8::Value> val);
37-
char* Data(v8::Handle<v8::Object> val);
38-
size_t Length(v8::Handle<v8::Value> val);
39-
size_t Length(v8::Handle<v8::Object> val);
35+
NODE_EXTERN bool HasInstance(v8::Handle<v8::Value> val);
36+
NODE_EXTERN bool HasInstance(v8::Handle<v8::Object> val);
37+
NODE_EXTERN char* Data(v8::Handle<v8::Value> val);
38+
NODE_EXTERN char* Data(v8::Handle<v8::Object> val);
39+
NODE_EXTERN size_t Length(v8::Handle<v8::Value> val);
40+
NODE_EXTERN size_t Length(v8::Handle<v8::Object> val);
4041

4142
// public constructor
42-
v8::Local<v8::Object> New(size_t length);
43+
NODE_EXTERN v8::Local<v8::Object> New(size_t length);
4344
// public constructor from string
44-
v8::Local<v8::Object> New(v8::Handle<v8::String> string);
45+
NODE_EXTERN v8::Local<v8::Object> New(v8::Handle<v8::String> string);
4546
// public constructor - data is copied
4647
// TODO(trevnorris): should be something like Copy()
47-
v8::Local<v8::Object> New(const char* data, size_t len);
48+
NODE_EXTERN v8::Local<v8::Object> New(const char* data, size_t len);
4849
// public constructor - data is used, callback is passed data on object gc
49-
v8::Local<v8::Object> New(char* data,
50-
size_t length,
51-
smalloc::FreeCallback callback,
52-
void* hint);
50+
NODE_EXTERN v8::Local<v8::Object> New(char* data,
51+
size_t length,
52+
smalloc::FreeCallback callback,
53+
void* hint);
5354

5455
// public constructor - data is used.
5556
// TODO(trevnorris): should be New() for consistency
56-
v8::Local<v8::Object> Use(char* data, uint32_t len);
57+
NODE_EXTERN v8::Local<v8::Object> Use(char* data, uint32_t len);
5758

5859
} // namespace Buffer
5960

Collapse file

‎src/smalloc.h‎

Copy file name to clipboardExpand all lines: src/smalloc.h
+14-13Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifndef NODE_SMALLOC_H_
2323
#define NODE_SMALLOC_H_
2424

25+
#include "node.h"
2526
#include "v8.h"
2627

2728
namespace node {
@@ -38,29 +39,29 @@ namespace smalloc {
3839
// mirrors deps/v8/src/objects.h
3940
static const unsigned int kMaxLength = 0x3fffffff;
4041

41-
typedef void (*FreeCallback)(char* data, void* hint);
42+
NODE_EXTERN typedef void (*FreeCallback)(char* data, void* hint);
4243

4344
/**
4445
* Allocate external memory and set to passed object. If data is passed then
4546
* will use that instead of allocating new.
4647
*/
47-
void Alloc(v8::Handle<v8::Object> obj, size_t length);
48-
void Alloc(v8::Handle<v8::Object> obj, char* data, size_t length);
49-
void Alloc(v8::Handle<v8::Object> obj,
50-
size_t length,
51-
FreeCallback fn,
52-
void* hint);
53-
void Alloc(v8::Handle<v8::Object> obj,
54-
char* data,
55-
size_t length,
56-
FreeCallback fn,
57-
void* hint);
48+
NODE_EXTERN void Alloc(v8::Handle<v8::Object> obj, size_t length);
49+
NODE_EXTERN void Alloc(v8::Handle<v8::Object> obj, char* data, size_t length);
50+
NODE_EXTERN void Alloc(v8::Handle<v8::Object> obj,
51+
size_t length,
52+
FreeCallback fn,
53+
void* hint);
54+
NODE_EXTERN void Alloc(v8::Handle<v8::Object> obj,
55+
char* data,
56+
size_t length,
57+
FreeCallback fn,
58+
void* hint);
5859

5960
/**
6061
* Free memory associated with an externally allocated object. If no external
6162
* memory is allocated to the object then nothing will happen.
6263
*/
63-
void AllocDispose(v8::Handle<v8::Object> obj);
64+
NODE_EXTERN void AllocDispose(v8::Handle<v8::Object> obj);
6465

6566
} // namespace smalloc
6667

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.