jmcnamara / XlsxWriter

A Python module for creating Excel XLSX files.
https://xlsxwriter.readthedocs.io
BSD 2-Clause "Simplified" License
3.66k stars 631 forks source link

_O_TEMPORARY flag is not defined on older Borland/Embarcadero compilers #1079

Closed mihaioltean closed 4 months ago

mihaioltean commented 4 months ago

Current behavior

In the tmpfileplus.c the _O_TEMPORARY flag is used, but the code does not compile due to the missing definition for this flag.

I have added my code:

#ifdef __BORLANDC__
    #define _O_TEMPORARY 0x0040
#endif

It works, but I do not know if this is the correct way to fix this problem

Expected behavior

To compile on C++Builder XE.

Sample code to reproduce

No code, but a compiler problem.

Environment

- XlsxWriter version: latest
- OS:Win10
- compiler: C++Builder XE

Any other information

No response

OpenOffice and LibreOffice users

jmcnamara commented 4 months ago

The tempfile comes from a vendored version of this code:

https://www.di-mgt.com.au/c_function_to_create_temp_file.html

So maybe that is the best place to confirm that the fix is correct.