Skip to content

Commit

Permalink
This should fix compiler linkage.
Browse files Browse the repository at this point in the history
  • Loading branch information
hgs3 committed Nov 1, 2024
1 parent 531d788 commit 311728b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions selective-mocking/_inject.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include <stddef.h> // for size_t

// Replace all calls to malloc() with wrap_malloc() in the source code.
// This change only affects _your_ code and not any 3rd party or
// system libraries. The real malloc() will still be invoked by
// 3rd party code.

#include <stddef.h> // for size_t

#define malloc wrap_malloc

#if defined(WIN32) // Pay attention to compiler linkage!
__declspec(dllexport)
#endif
void *wrap_malloc(size_t size);

0 comments on commit 311728b

Please sign in to comment.