News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#31
Beginner questions / Re: Pomake incompatibility
Last post by TimoVJL - November 11, 2025, 11:43:12 PM
Missing CR/LF from last line.

Since version 11 something is wrong with it.
pomake v.10 works with a your example.

EDIT:
Pelles Make Utility, Version 13.00.0
Copyright (c) Pelle Orinius 1995-2025

>pomake -f example1.mak
        type file1.c
// I am file1
        type file2.c
// I am file2
#32
Beginner questions / Re: Error #2158 Unrecognized t...
Last post by TimoVJL - November 11, 2025, 08:20:13 PM
Quote/Go Accepts 'old' names for C runtime functions.
#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
typedef __SSIZE_TYPE__ _ssize_t;
#ifdef __POCC__OLDNAMES
typedef __SSIZE_TYPE__ ssize_t;
#endif /* __POCC__OLDNAMES */
#endif /* SSIZE_T_DEFINED */
#33
Beginner questions / Error #2158 Unrecognized type ...
Last post by Jerry - November 11, 2025, 07:07:32 PM
Dear all,

I am working on adding a graphical user interface to one of my curve-fitting codes. The code compiles and runs correctly with several other compilers (CodeBlocks 2025, Visual Studio, Intel OneAPI, and GCC), but Pelles C reports the following error:

Error #2158: Unrecognized type 'ssize_t'


I have already checked previous discussions on this forum and tried the common suggestions, including adding:

#include <sys/types.h>
#define __STDC_WANT_LIB_EXT2__ 1


Unfortunately, the error persists.

Does anyone know how to properly enable or define ssize_t in Pelles C? My understanding is that ssize_t should be available by default, as it is in the other compilers I have tested.

Any suggestions or guidance would be greatly appreciated. Thank you.
#34
Beginner questions / Pomake incompatibility
Last post by italofutura - November 11, 2025, 01:44:55 PM
Hi I try to run this makefile.

Isend here in order to not spam the bug reports (in case I misuse pomake)

Jom 1.1.4 Windows 11 x64

and

Nmake ("c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\nmake.exe")

work fine.

Pomake runs the first two dependency lines and crashes with Access Violation.
#35
User contributions / Re: Boot time
Last post by Vortex - November 10, 2025, 08:25:51 PM
Hi Timo,

There is also the GetTickCount function. The documentation states that :

QuoteNtQuerySystemInformation may be altered or unavailable in future versions of Windows.

https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntquerysysteminformation
#36
User contributions / Re: Boot time
Last post by TimoVJL - November 10, 2025, 09:10:14 AM
Quote from: Vortex on November 09, 2025, 08:22:44 PMAnother method to get the boot time is to use the GetTickCount64 API function.
Works only since Vista.

This is quite short.
    NtQuerySystemInformation(SystemTimeOfDayInformation, &stodi, sizeof(stodi), 0);
    // (*(LONGLONG*)&stodi.BootTime) -= (*(LONGLONG*)&stodi.TimeZoneBias);
    stodi.BootTime.QuadPart -= stodi.TimeZoneBias.QuadPart;
    (*(LONGLONG*)&ft) = (*(LONGLONG*)&stodi.BootTime);
    FileTimeToSystemTime(&ft, &st);
#37
User contributions / Re: Boot time
Last post by Vortex - November 09, 2025, 08:22:44 PM
Hi Timo,

Another method to get the boot time is to use the GetTickCount64 API function.
#38
Work in progress / Re: win32-doc md files
Last post by John Z - November 09, 2025, 05:25:49 PM
The completed project is posted over in User Contributions -
https://forum.pellesc.de/index.php?topic=11672.0

Cheers,
John Z
#39
User contributions / Offline GitHub MS Documents
Last post by John Z - November 09, 2025, 05:21:33 PM
Attached is the full release for the access program for the win32-docs.zip downloaded from GitHub:
https://github.com/MicrosoftDocs/win32

This provides a way to use and access documentation (mainly the API Names) from the GitHub documentation effort off-line, and searchable.

The documents can be viewed in the .md format or in a .html format.  Searching is provided in the .md display, and of course intrinsically in the web browser viewing .html.

TimoVJL provided the code/method to search the win32 documentation for API NAMES from which I created a database and the rest of the program.  See readme_v4.txt, for other external source code attributions.

It is possible that the MD_Files_3.db3 could be expanded in the future to include all topics in the win32-docs.zip and that would not require changing the basic program to be immediately useful.  TBD

John Z
#40
Work in progress / Re: ChatGPT examples
Last post by Vortex - November 09, 2025, 10:01:13 AM
Console application to get the boot time :

/* ChatGPT code */

#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <stdio.h>

int main(void)
{
    FILETIME ftNow, ftBootUtc, ftBootLocal;
    ULONGLONG now100ns;
    ULONGLONG uptimeMs;
    ULONGLONG boot100ns;
    SYSTEMTIME st;

    /* current system time as FILETIME (UTC, 100-ns intervals since 1601) */
    GetSystemTimeAsFileTime(&ftNow);
    now100ns = ((ULONGLONG)ftNow.dwHighDateTime << 32) | ftNow.dwLowDateTime;

    /* milliseconds since system start */
    uptimeMs = GetTickCount64(); /* Vista+; returns milliseconds since boot */

    /* convert uptime to 100-ns units and subtract */
    boot100ns = now100ns - (uptimeMs * 10000ULL);

    /* convert back to FILETIME structure */
    ftBootUtc.dwLowDateTime  = (DWORD)(boot100ns & 0xFFFFFFFF);
    ftBootUtc.dwHighDateTime = (DWORD)(boot100ns >> 32);

    /* show UTC boot time */
    if (FileTimeToSystemTime(&ftBootUtc, &st)) {
        printf("Boot time (UTC)  : %04u-%02u-%02u %02u:%02u:%02u\n",
               st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
    }

    /* convert to local time and show */
    if (FileTimeToLocalFileTime(&ftBootUtc, &ftBootLocal) &&
        FileTimeToSystemTime(&ftBootLocal, &st)) {
        printf("Boot time (local): %04u-%02u-%02u %02u:%02u:%02u\n",
               st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
    }

    return 0;
}