From ced80a9617312381a000fa3390fe8865dec4d968 Mon Sep 17 00:00:00 2001 From: Thomas van Doornmalen Date: Sat, 12 Mar 2022 19:57:43 +0100 Subject: [PATCH] Fix the example for MSVC in the Embedding Julia documentation --- doc/src/manual/embedding.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/src/manual/embedding.md b/doc/src/manual/embedding.md index 22c2f66f9b8b0..147cb2bb336cf 100644 --- a/doc/src/manual/embedding.md +++ b/doc/src/manual/embedding.md @@ -141,16 +141,21 @@ Now the build command is simply `make`. If the `JULIA_DIR` environment variable hasn't been setup, add it using the System panel before starting Visual Studio. The `bin` folder under JULIA_DIR should be on the system PATH. -We start by opening Visual Studio and creating a new Console Application project. To the 'stdafx.h' -header file, add the following lines at the end: +We start by opening Visual Studio and creating a new Console Application project. Replace the +generated C++ code with the following: -```c -#include -``` +```c++ +#include +#include + +template +static inline T jl_atomic_load_relaxed(volatile T *obj) +{ + return jl_atomic_load_acquire(obj); +} -Then, replace the main() function in the project with this code: +#include -```c int main(int argc, char *argv[]) { /* required: setup the Julia context */