• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..10-Aug-2021-

cran/H13-May-2020-387308

fixed/H19-Apr-2021-2,275933

front-ends/H03-May-2022-2,2301,621

getline/H19-Apr-2021-2,5932,134

installer/H03-May-2022-2,5862,193

unicode/H25-Sep-2018-76

windlgs/H25-Sep-2018-328246

CHANGES.RdH A D25-Sep-201832.6 KiB870712

CHANGES0H A D25-Sep-201869.2 KiB2,0991,389

CHANGES1H A D08-Aug-202018.5 KiB579381

CHANGES2H A D25-Sep-201850.3 KiB1,384937

COPYRIGHTS.winH A D14-Apr-20205.4 KiB145105

INSTALLH A D25-Sep-2018549 2414

Maintainers.notesH A D25-Sep-20187.9 KiB293202

MakefileH A D19-Apr-202112.7 KiB439323

MkRules.distH A D19-Apr-20215.7 KiB172132

MkRules.rulesH A D19-Apr-20214 KiB172147

READMEH A D25-Sep-20188.5 KiB227162

README.RtermH A D26-Mar-20203.6 KiB7464

README.compilationH A D19-Apr-20215.2 KiB199135

README.packagesH A D25-Sep-20184.6 KiB13895

Rdll.hideH A D19-Apr-202124.4 KiB1,5641,563

console.cH A D26-Mar-202055.8 KiB2,2981,974

console.hH A D25-Sep-20182.2 KiB6337

consolestructs.hH A D25-Sep-20184.4 KiB14798

dllversion.rcH A D25-Sep-2018769 2725

dos_wglob.cH A D26-Mar-202024.6 KiB981691

dos_wglob.hH A D25-Sep-20183.3 KiB7530

dynload.cH A D25-Sep-20185.9 KiB211145

e_pow.SH A D25-Sep-20186.4 KiB327241

editor.cH A D19-Apr-202121.8 KiB867720

editor.hH A D25-Sep-20181.5 KiB4118

embeddedR.cH A D07-Jan-20213.7 KiB14997

extra.cH A D02-Apr-202034.1 KiB1,211941

guicolors.hH A D25-Sep-20181.1 KiB3611

malloc.cH A D20-Apr-2021177.2 KiB5,1152,808

opt.cH A D25-Sep-20182.3 KiB12590

opt.hH A D25-Sep-2018963 255

pager.cH A D19-Apr-202114.3 KiB573484

preferences.cH A D25-Sep-201829 KiB930779

preferences.hH A D25-Sep-20181.6 KiB5425

psignal.cH A D25-Sep-201811.5 KiB454325

rgui_UTF8.hH A D28-Mar-20191 KiB295

rhome.cH A D02-Jul-20213.6 KiB12167

rt_complete.cH A D25-Sep-20184.6 KiB159108

rui.cH A D19-Apr-202138.1 KiB1,5311,256

rui.hH A D25-Sep-20183 KiB10669

run.cH A D19-Apr-202128 KiB1,047791

run.hH A D28-Mar-20192 KiB6530

shext.cH A D25-Sep-20182.3 KiB8044

sys-win32.cH A D28-Mar-201910 KiB341222

system.cH A D23-Jun-202135.6 KiB1,254881

win-nls.hH A D25-Sep-20181.3 KiB3514

README

1R @FULLVERSION@ for Windows
2===================
3
4This distribution contains a binary distribution of R-@RVER@ to run on
5Windows XP and later (including 64-bit versions of Windows) on ix86
6and x86_64 chips.  It is designed to be as close as possible to the
7implementation on Unix, but see the list of differences below.  The
8port was by Guido Masarotto, Brian Ripley and Duncan Murdoch.
9
10
11Installation
12============
13
14The distribution is distributed as an installer @RWVER@-win.exe.  Just
15run this for a Windows-style installer.
16
17For more details, including command-line options for the installer and
18how to uninstall, see the rw-FAQ.  If you are reading this as part of
19an installed version of R, that is both a file rw-FAQ in this directory
20and a file doc\html\rw-FAQ.html.
21
22
23Usage
24=====
25
26There are two versions of the R executable in @RWVER@\bin\i386 (32-bit)
27and @RWVER@\bin\x64 (64-bit).  By default only the first is
28installed on 32-bit versions of Windows, and both on 64-bit OSes.
29
30GUI:
31
32Rgui.exe runs as a standard Windows GUI executable and provides an R
33console in its own window.  It takes the standard R command-line
34arguments; these are most easily set by making a shortcut to
35...\@RWVER@\bin\i386\Rgui.exe (or x64\Rgui.exe) and adding the
36arguments in the Target field.  Set the 'Start in' field of the
37shortcut to the directory you want to use as the working directory
38(where workspaces and files are saved to and loaded from).  The
39installer creates a shortcut on the desktop for you (by default).
40
41You have a choice of interface: SDI (separate windows) or MDI
42(multiple child windows in one large window).  MDI is the default:
43select SDI by adding --sdi in the Target field: this can also be
44selected from the installer.
45
46Command-line editing is available: see Help | Console for details.
47
48The menus provide shortcuts to some R commands such as help, help.start,
49apropos, ls, load, save.image, search.
50
51The 'load' menu items (Source R code, Display file, Load Workspace)
52keep track of the directory that was last used, and start their dialog
53boxes from that directory the next time they are used.  That directory
54can be made the working directory by the File | Change dir menu item.
55All the 'save' menu items start dialog boxes at the current working
56directory: this includes 'Save Workspace' and the various ways to save
57graphics, as well as saving the workspace at the end of the session.
58
59Note that a few of the text help files use accented Western European.
60To see all the characters you must use an appropriate font
61(European-language True Type fonts should be OK).  To check if your
62preferred font has these characters, try "help(text)" and look at the
63examples.
64
65
66TERMINAL/BATCH:
67
68Rterm.exe will run from a command line such as a 'Command Prompt'
69window running the standard shell, cmd.exe, as well as the ports of
70bash and tcsh that we use.  Its primary purpose is to allow batch
71operation, but it does provide all the facilities needed for
72interactive use, including command-line editing (see the file
73README.Rterm).
74
75Batch use: At its simplest, Rterm.exe can be used in a batch mode by
76commands like
77
78Rterm.exe --no-restore --no-save < infile > outfile 2>&1
79
80although users will probably want to set up simple .bat or .cmd files
81to run batch jobs. You can also use it via R CMD BATCH: see ?BATCH or
82R CMD BATCH --help.
83
84Use with ESS: You can use Rterm.exe to provide inferior R-mode in ESS
85under NTEmacs.  The pager is automatically set to "console" so text
86help will be displayed in emacs buffers.
87
88
89GRAPHICS:
90
91The screen device is called windows().  This is launched
92automatically, and can also be launched explicitly by windows() from
93both Rgui.exe and Rterm.exe.  A printer device can be opened using
94win.print(), and graphs drawn as metafiles by win.metafile().
95
96The graphics device pops up a separate window which has two menus.  The
97device's File menu allows saving or printing or to run dev.off().
98
99The History menu allows the recording of plots.  When plots have been
100recorded they can be reviewed by PgUp and PgDn, saved and replaced.
101Recording can be turned on automatically (the Recording item on the
102list) or individual plots can be added (Add or the INS key).
103
104The whole plot history can be saved to or retrieved from an R variable
105in the global environment.
106  The format of recorded plots may change between R versions.
107  Recorded plots should NOT be used as a permanent
108  storage format for R plots.
109
110There is only one graphics history shared by all the windows devices.
111
112
113Customization
114=============
115
116Environment variables can be set as NAME=value at the end of the
117command line, including in a shortcut.  They can also be set (as
118NAME=value lines) in the file .Renviron in the working directory, or
119if that does not exist HOME\.Renviron.
120
121Many aspects of the console (size, appearance, font, font size,
122colours) can be customized by editing the file etc\Rconsole, and a
123copy with a user's settings can be put in her HOME directory or in the
124working directory.  (The exact sequence is to search the directory
125pointed to by the first found of the environment variables R_USER then
126HOME, then the Windows "personal" directory (typically
127'C:\Users\username\My Documents' on recent versions of Windows and
128'C:\Documents and Settings\username\My Documents' on XP) then
129{HOMEDRIVE}{HOMEPATH} then the working directory, finally R_HOME\etc.
130This also applies to .Renviron and other uses of 'HOME' in our
131documentation.)  The file contains a description of the settings that
132can be altered.  See also ?Rconsole.
133
134An alternative way to edit the Rconsole file is to use the GUI
135preferences item on the Edit menu in Rgui.exe.  This can change some
136of the settings (for example colours, font and window sizes) on the
137current running console.
138
139The mapping between Windows fonts and the font number used in R's
140graphics can be set by editing the file etc\Rdevga, and a copy with a
141user's settings can be put in the HOME or working directory (see the
142description of Rconsole).  This mapping applies to both the screen
143device and the printer device.
144
145Many R defaults can be set in the file R_HOME\etc\Rprofile or a user's
146file .Rprofile.  In particular:
147
148- The pager is set by options(pager=).  The default is "internal"
149  which brings up a separate console-like window.  The internal pager
150  can use a single window or a different window for each topic shown
151  (configurable in Rconsole).  Other possibilities we have used are
152  "notepad" and "console" to list the files in the console (Rgui.exe)
153  or terminal window (Rterm.exe).
154
155
156Adding packages
157===============
158
159Binaries for many packages are available under
160CRAN/bin/windows/contrib.  These are zip files which should be
161unpacked in @RWVER@\library.  The simplest option is use the items on
162the Packages menu to install from a zip file or to download from CRAN.
163
164Private libraries of packages can be used and can be specified by the
165environment variable R_LIBS.  (Separate directories by ";" in this
166version.)  They will not be linked to HTML help.  In more detail, to
167use packages installed in directory R:\libraries\gm, set
168
169R_LIBS=R:\libraries\gm
170
171in the environment or your .Renviron file or on the command line, or
172add the line
173
174.libPaths("R:/libraries/gm")
175
176to your .Rprofile or at the end of R_HOME\etc\Rprofile.
177
178To install a package from source code you need the source-package
179distribution installed from @RWVER@-win32.exe (but not the R sources).
180The 'R Installation and Administration' manual contains detailed
181instructions.
182
183
184Differences from Unix versions of R
185===================================
186
187- R can be interrupted by Esc in Rgui and by Ctrl-C or Ctrl-Break in Rterm:
188  Ctrl-C is used for copying in the GUI version.  C-c C-c works
189  under NTemacs.
190
191- Command-line editing is always available, but is simpler than
192  under readline-based input on Unix.  For Rgui.exe, see the menu item
193  'Help | Console', for Rterm.exe the file README.Rterm.
194
195- Paths to files can be specified with "/" or "\\".
196
197- system() is enhanced here and does not automatically use a shell.
198  See its help page and that of shell().
199
200- graphics device bmp() is available in this version.
201
202
203Using package tcltk
204===================
205
206The package tcltk supports building graphical interfaces with Tcl/Tk.
207"Support Files for Package tcltk" needs to be selected from the
208installer for this to work; alternatively you can use an existing
209installation of Tcl/Tk 8.6.x by following the instructions in the
210rw-FAQ.
211
212
213Building From Source
214====================
215
216See the 'R Installation and Adminstration' Manual
217(doc\manual\R-admin.html).
218
219
220Feedback
221========
222
223Please send comments and bug reports to
224
225	R-windows@r-project.org
226
227

README.Rterm

1README for Rterm.exe
2====================
3
4Rterm.exe can be used in three distinct modes:
5
61) Interactively in an MSDOS / Commands window.
72) In batch mode by redirecting its input from a file or pipe.
83) As a no-echo process for ESS mode in NTEmacs with flag --ess.
9
10Its purpose is to provide something similar to the main Unix interface
11for R, including a batch capability.  The command-line arguments are
12the same as those for RGui.exe and are documented in `An Introduction
13to R' in the section `Invoking R under Windows' (--mdi and --sdi are
14accepted but do nothing).  Batch use is covered in the rw-FAQ Q2.10.
15
16In interactive use the interpreter can be interrupted by Ctrl-C or
17Ctrl-Break.  Input is interpreted as-is except for the keys
18interpreted by getline (see below) and that special characters
19can be entered by Alt+numerical-key-pad sequences of up to 3 characters,
20so Alt+123 and Alt+72 give {H, for example.
21
22Command-line editing and history in interactive use
23---------------------------------------------------
24
25Input editing handles a single line and so scrolls long lines left and
26right on the same line.  Until the user presses the RETURN key they
27can use Emacs-style line editing commands and can traverse the history
28of lines previously typed.
29
30Entering printable keys generally inserts new text into the buffer (unless
31in overwrite mode, see below).  Other special keys can be used to modify
32the text in the buffer.  In the description of the keys below, ^n means
33Control-n, or holding the CONTROL key down while pressing "n".  Errors
34will ring the terminal bell.  A 'word' is delimited by spaces.
35
36left/right, ^F/^B   : Move cursor forward/backward one character.
37up/down,    ^P/^N   : Move to previous/next item on history list.
38Home, ^A	: Move cursor to beginning of the line.
39End,  ^E 	: Move cursor to end of the line.
40ESC-F	: Move cursor forward one word.
41ESC-B   : Move cursor backward one word.
42^D, DEL	: Delete the character under the cursor.
43^H	: Delete the character to the left of the cursor.
44^K	: Kill from the cursor to the end of line.
45^L	: Redraw current line.
46^O	: Toggle overwrite/insert mode. Initially in insert mode. Text
47	  added in overwrite mode (including yanks) overwrite
48	  existing text, while insert mode does not overwrite.
49^R/^S   : Perform incremental reverse/forward search for string on
50	  the history list.  Typing normal characters adds to the current
51	  search string and searches for a match. Typing ^R/^S marks
52	  the start of a new search, and moves on to the next match.
53	  Typing ^H or DEL deletes the last character from the search
54	  string, and searches from the starting location of the last search.
55	  Therefore, repeated DEL's appear to unwind to the match nearest
56	  the point at which the last ^R or ^S was typed.  If DEL is
57	  repeated until the search string is empty the search location
58	  begins from the start of the history list.  Typing ESC or
59	  any other editing character accepts the current match and
60	  loads it into the buffer, terminating the search.
61^T	: Transpose the characters under and to the left of the cursor.
62^U      : Deletes the entire line
63^W      : Deletes the previous word
64^Y	: Yank previously killed text back at current location.  Note that
65	  this will overwrite or insert, depending on the current mode.
66TAB	: Within quotes, completes the current word as a file name,
67	  otherwise as an R object name.  Completion is does as far as
68	  can be done unambiguously.  A second press shows alternative
69	  completions.  However, if environment variable R_COMPLETION is
70	  set to FALSE, this advances to the next tab stop (set at every
71	  8th column).
72NL, CR  : returns current buffer to the program.
73
74

README.compilation

1The R for Windows Build Process
2===============================
3
4from the point of view of a Unix installer of R.
5
6Compilation of C/Fortran code is done in two pathways.
7
81) standard and add-on packages, the most similar to Unix.
9
10The primary Makefiles are
11$(R_HOME)/etc${R_ARCH}/Makeconf
12share/make/winshlib.mk
13
14included in that order.  Some settings in Makeconf are substituted in
15etc/Makeconf by fixed/Makefile, taken from MkRules.
16
17
182) Everything else, where the primary Makefile is MkRules which is
19where all the customization is done.  This is included by all
20Makefile.win files in directories above this one and
21
22./Makefile
23./cran/Makefile
24./fixed/Makefile
25./front-ends/Makefile
26./getline/Makefile
27./installer/Makefile
28
29and replaces Unix's top-level Makeconf.
30
31
32The largest difference from Unix (even a R-shlib build) is the use of
33DLLs, which require the exported symbols to be listed (via nm) in a
34.def file and fed to the compiler with the object files for linking.
35
36In recent years DLLs are linked to directly as libraries, but there
37remains provision for import libraries via lib%.dll.a: %.def rules.
38
39Making executables has a number of Windows-specific features, done in
40front-ends/Makefile:
41
42- A resource compiler is used to compile in version information, an
43  icon and a manifest.  Also done for version information in all the
44  other DLLs under bin and modules (R.dll Rblas.dll Rgraphapp.dll
45  Riconv.dll Rlapack.dll internet.dll lapack.dll).
46
47- LINKFLAGS includes flags for the stack size and to allow addressing
48  over 2GB for 32-bit executables.
49
50A resource compiler is used to add version information to the DLLs
51under directories bin and modules.
52
53The default is to compile without debug info: this can be enabled by
54using 'make DEBUG=T' from this directory, or install add-on packages
55with Rcmd INSTALL --debug.  Otherwise DLLs and executables are
56stripped.
57
58
59Link-Time Optimization
60======================
61
62To enable LTO for building R set the LTO macro in MkRules.local, to
63-flto or e.g. -flto=8 to use 8 threads.
64
65Checking of packages with LTO can be performed by setting the LTO_OPT
66macro to -flto in MkRules.local and using Rcmd INSTALL --use-LTO.
67
68For an installed version of R it should suffice to edit the value of
69LTO_OPT in the etc/*/Makeconf files or to set it in a personal or site
70Makevars file.
71
72[Unlike a Unix-alike, LTO/LTO_OPT are used for Fortran as well as C/C++.]
73
74
75Cross-compilation
76=================
77
78Linux distributions including Fedora, Debian and Ubuntu provide
79cross-compilers and many cross-compiled libraries for both 32- and
8064-bit Windows.  For example, on Fedora 32 for a 64-bit build one
81might install the RPMs
82
83mingw64-binutils
84mingw64-bzip2
85mingw64-cairo
86mingw64-cpp
87mingw64-crt
88mingw64-filesystem
89mingw64-gcc
90mingw64-gcc-c++ (not needed for R, but needed for cairo, icu and libtiff)
91mingw64-gcc-gfortran
92mingw64-headers
93mingw64-libgomp
94mingw64-libpng
95mingw64-libjpeg-turbo
96mingw64-libtiff
97mingw64-pcre2
98mingw64-pkg-config
99mingw64-readline
100mingw64-tcl
101mingw64-termcap
102mingw64-tk
103mingw64-winpthreads
104mingw64-xz-libs
105mingw64-zlib
106
107or install the mingw32- variants for a 32-bit build.  At the time of
108writing this used GCC 9.2.1.
109
110To build all the compiled code, set BINPREF in MkRules.local, e.g. to
111
112WIN = 64
113BINPREF64 = /usr/bin/x86_64-w64-mingw32-
114
115or
116
117WIN = 32
118BINPREF = /usr/bin/i686-w64-mingw32-
119
120Setting LTO is supported.
121
122Then in this directory
123
124make MkRules rbuild rpackages-cross
125
126To make the cairo devices, set something like
127
128USE_CAIRO = TRUE
129CAIRO_CPPFLAGS = -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/cairo
130CAIRO_LIBS = "-lcairo -lpixman-1 -lpng -lz -lgdi32 -lmsimg32"
131
132in MkRules.local and run
133
134make cairodevices
135
136
137This will link to the DLLs of external software and for libgomp and
138pthreads (for OpenMP).
139
140For a more static build, install
141
142mingw64-bzip2-static
143mingw64-libpng-static
144mingw64-libjpeg-turbo-static
145mingw64-libtiff-static
146mingw64-pcre2-static
147mingw64-winpthreads-static
148mingw64-xz-libs-static
149mingw64-zlib-static
150
151and remove the corresponding libfoo.dll.a files from
152/usr/x86_64-w64-mingw32/sys-root/mingw/lib, and libgomp.dll.a.  (The
153build still uses DLLs for libgcc_s_seh and Tcl/Tk).  For a static
154build of the Cairo devices one would need other RPMs like
155
156mingw64-cairo-static
157mingw64-fontconfig-static
158mingw64-freetype-static
159mingw64-pixman-static
160
161Rather than remove the .dll.a files, one could experiment with -Wl,-Bstatic.
162
163There are curl and ICU libraries for optional features.  Settings for
164Fedora's libs (DLL versions):
165
166USE_LIBCURL = YES
167CURL_LIBS = -lcurl
168
169USE_ICU = YES
170ICU_LIBS = -licuuc -licui18n -licudata
171
172There is a static version for curl but not ICU.
173
174
175Cross-building packages
176=======================
177
178There is experimental minimal support for cross-building packages.
179
180Copy {bin,etc}/{i386,x64} from this build to a standard Linux build.
181
182Edit the copy of etc/*/Makeconf to have
183
184R_WIN = /path/to/top/directory/of/this/build
185R_XTRA_CPPFLAGS = -I"$(R_WIN)/include" -DNDEBUG
186
187Set the environment variable R_CROSS_BUILD to i386 or x64.
188
189Use R CMD INSTALL as usual. (This does not do a staged install nor
190test loading.)  --use-LTO is supported if LTO_OPT was set.
191
192R CMD INSTALL --build will produce a zipped installation.
193
194Should a package require external libraries, these can be placed under
195LOCAL_SOFT as defined in etc/*/Makeconf in the copy.
196
197
198
199

README.packages

1Writing packages for R
2======================
3
4See the Writing R Extensions manual for a full description of how
5to write a package.
6
7
8Building from a source-code library under Windows
9=================================================
10
11Instructions for installing the toolset and building packages using the
12standard methods are in the `R Installation and Administration' manual
13(which is available in various formats as R-admin.* in the doc/manual
14directory).
15
16This file contains instructions for non-standard situations:
17
18 - Using Microsoft Visual C++
19 - Using Borland C++
20 - Using other compilers and languages
21
22All the examples given here have worked at some point with 32-bit R,
23but are mainly of historical interest.
24
25
26Using Visual C++
27================
28
29You may if you prefer use Visual C++ to make the DLLs (unless they use
30Fortran source!). The notes here were tested with VC++6.
31
32First build the import library Rdll.lib by (from the sources)
33
34	make R.exp
35
36	lib /def:R.exp /out:Rdll.lib
37or, depending on your version of VC++
38	link /lib /def:R.exp /machine:x86 /out:Rdll.lib
39
40Another way to make R.exp is to use pexports.exe from mingw-utils,
41e.g. pexports R.dll > R.exp.
42
43Then you can compile the objects and build the DLL by
44
45	cl /MT /Ox /D "WIN32"  /c *.c
46	link /dll /def:mypkg.def /out:mypkg.dll *.obj Rdll.lib
47
48where you will need to create the .def file by hand listing the entry
49points to be exported.  (If there are just a few you can use /export
50flags instead.) If the C sources use R header files you will need to
51arrange for these to be searched, perhaps by including in the cl line
52
53	/I ..\..\..\include
54
55If you build a debug version of the DLL in the development
56environment, you can debug the DLL code there just by setting the
57executable to be debugged as the full path to the R front-end.
58
59Extra care is needed when referencing variables (rather than
60functions) exported from R.dll.  These must be declared
61__declspec(dllimport) (as in R's own header files).
62
63For some applications making use of the R API headers you will need to
64build import libraries for Rblas.dll or graphapp.dll and link against
65those.
66
67VC++6 lacks some standard functions such as isnan and isfinite.  To use
68R's macros you will need
69
70#undef ISNAN
71#define ISNAN(x) _isnan(x)
72#undef R_FINITE
73#define R_FINITE(x) _finite(x)
74
75for example.  Even then, we have seen examples of IEC60559 arithmetic
76being performed incorrectly.
77
78
79Using Borland C++
80=================
81
82Borland C++5.5 is available as a free download from
83http://www.borland.com/bcppbuilder/freecompiler/ and as part of C++
84Builder 5.  The following will make convolve.dll from convolve.c (flag
85-6 optimizes for a Pentium Pro/II/III/4, and -u- removes extra underscores)
86
87bcc32 -u- -6 -O2 -WDE convolve.c
88
89You can build an import library for R.dll by
90
91make R.exp
92implib R.lib R.exp
93
94and then add R.lib to the bcc32 command line, for example (from
95Venables & Ripley's `S Programming')
96
97bcc32 -u- -6 -O2 -WDE -I\R\R-2.3.0\src\include VCrndR.c R.lib
98
99We believe that when referencing variables (rather than functions)
100exported from R.dll these must be declared __declspec(dllimport) just
101as for VC++.
102
103
104Using other compilers and languages
105===================================
106
107To use C++ see the section in the R for Windows FAQ.  You can include
108C++ code in packages and the supplied Makefiles will compile with g++
109and link the DLL using g++ (and hence link against libstdc++).  Use of
110C++ I/O may or may not work, and has been seen to crash R.
111
112To use F90 or F95, see `Writing R Extensions'.
113
114For other compilers you will need to arrange to produce a DLL with
115cdecl (also known as _cdecl or __cdecl) linkage.  The MinGW port (and
116VC++) uses no `name mangling' at all, so that if for example your
117compiler adds leading or trailing underscores you will need to use the
118transformed symbol in the call to .C in your R code.  Many compilers
119can produce cdecl DLLs by a suitable choice of flags, but if yours
120cannot you may need to write some `glue' code in C to interface to the
121DLL.
122
123If you use .Fortran this appends an underscore and does no case
124conversion at all to the symbol name.  It is normally best to use .C
125with compilers other than gfortran and map the name manually if
126necessary.
127
128Care is needed in passing character strings to and from a DLL by .C:
129they must be equivalent to the C type char** and null-terminated.  Not
130even the MinGW g77 Fortran used null-terminated strings. (g77 was in
131GCC 3.x.y, superseded by gfortran.)
132
133WARNING: DLLs made with some compilers reset the FPU in their startup
134code and this will cause operations such as
1350./0. to crash R.  You can re-set the FPU to the correct values by a
136call to the C entry point Rwin_fpset().
137
138