On Saturday, 2 December 2023 at 08:36:01 UTC, Stefan Koch wrote:
On Saturday, 2 December 2023 at 05:16:43 UTC, name wrote:
Minimum thing to reproduce bug:
[...]
It doesn't show up since it's defined as an Identifier
Expression which cannot be resolved.
But why can't it be resolved?
Minimum thing to reproduce bug:
main.d:
```d
import test;
void main() {
auto a = FILE_MAP_READ;
}
```
test.c
```c
#define SECTION_MAP_READ 0x0004
#define FILE_MAP_READ SECTION_MAP_READ
```
build with ```"D:\dmd.2.105.3.windows\dmd2\windows\bin64\dmd.exe"
-c test.c -vcg-ast```.
On Friday, 1 December 2023 at 10:23:08 UTC, Kagamin wrote:
In C macros can be defined to any expression, so ImportC
interprets these parentheses as arbitrary expression macros and
skips them thinking they are helper macros that can't be always
translated.
But does that explain why using
So, uh, I tried deleting the parens off GENERIC_READ's value:
winnt.h:
```c
//
// These are the generic rights.
//
#define GENERIC_READ 0x8000L
#define GENERIC_WRITE(0x4000L)
#define GENERIC_EXECUTE (0x2000L)
#define
On Friday, 1 December 2023 at 08:45:30 UTC, Kagamin wrote:
Is GENERIC_WRITE awailable?
No, it's not.
I tried building with LDC 1.35.0:
```"D:\ldc2-1.35.0-windows-x64\bin\ldc2.exe" main.d -i
-vcg-ast```.
winnt.h:
```c
// begin_wdm
// begin_ntoshvp
typedef DWORD ACCESS_MASK;
typedef
Weird... building with ```dmd -m64 -i main.d``` works fine.
Then, I tried calling
[CreateFileW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew), passing ```GENERIC_READ``` for ```[in] dwDesiredAccess```; I get this:
```main.d(7): Error: undefined identifier
On Thursday, 30 November 2023 at 08:54:40 UTC, Kagamin wrote:
You can declare them
```
extern(C) void _InterlockedExchangeAdd(){ assert(false); }
```
That works, thanks.
Every time I go to use something like strip it bitches and gives
me errors. Why can't I simply do somestring.strip("\n")???
import std.string would be the likely strip yet it takes a range
and somestring, for some retarded reason, isn't a range. strip
isn't the only function that does this.